<commit_before>﻿using UnityEngine;
using UnityEditor;
using UnityEditor.Callbacks;
using System.Collections;
using UnityEditor.iOS.Xcode;
using System.Linq;
using System.Text;
using System.Xml;
using System.IO;

#if UNITY_IOS
public class BranchPostProcessBuild {

	[PostProcessBuild(900)]
	public static void ChangeBranchBuiltProject(BuildTarget buildTarget, string pathToBuiltProject) {
		
		if ( buildTarget == BuildTarget.iOS ) {
			ChangeXcodePlist(pathToBuiltProject);
			ChangeXcodeProject(pathToBuiltProject);
		}

	}

	public static void ChangeXcodePlist(string pathToBuiltProject) {
		// Get plist
		string plistPath = pathToBuiltProject + "/Info.plist";
		PlistDocument plist = new PlistDocument();
		plist.ReadFromString(File.ReadAllText(plistPath));
		
		// Get root
		PlistElementDict rootDict = plist.root;<commit_msg>Move compiler #if statement to top of file. - Unity gives a compilation error on some versions when including UnityEditor.iOS.Xcode if IOS target is not installed.<commit_after>#if UNITY_IOS

using UnityEngine;
using UnityEditor;
using UnityEditor.Callbacks;
using System.Collections;
using UnityEditor.iOS.Xcode;
using System.Linq;
using System.Text;
using System.Xml;
using System.IO;

public class BranchPostProcessBuild {

	[PostProcessBuild(900)]
	public static void ChangeBranchBuiltProject(BuildTarget buildTarget, string pathToBuiltProject) {
		
		if ( buildTarget == BuildTarget.iOS ) {
			ChangeXcodePlist(pathToBuiltProject);
			ChangeXcodeProject(pathToBuiltProject);
		}

	}

	public static void ChangeXcodePlist(string pathToBuiltProject) {
		// Get plist
		string plistPath = pathToBuiltProject + "/Info.plist";
		PlistDocument plist = new PlistDocument();
		plist.ReadFromString(File.ReadAllText(plistPath));
		
		// Get root
		PlistElementDict rootDict = plist.root;
{'fraction_non_alphanumeric': 0.08314977973568281, 'fraction_numerical': 0.003303964757709251, 'mean_word_length': 5.443262411347518, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6125585', 'n_tokens_mistral': 594, 'n_tokens_neox': 531, 'n_words': 137}