public void ApplyMod(string path, string pbxmod) { XCMod mod = new XCMod(path, pbxmod); this.mod = mod; ApplyMod(mod); }
public void ApplyMod(XCMod mod) { PBXGroup modGroup = this.GetGroup(mod.group); //Debug.Log("Adding libraries..."); //PBXGroup librariesGroup = this.GetGroup( "Libraries" ); foreach (XCModFile libRef in mod.libs) { string completeLibPath = System.IO.Path.Combine("usr/lib", libRef.filePath); this.AddFile(completeLibPath, null, modGroup, "SDKROOT", true, libRef.isWeak); } //Debug.Log("Adding frameworks..."); PBXGroup frameworkGroup = this.GetGroup("Frameworks"); foreach (string framework in mod.frameworks) { string[] filename = framework.Split(':'); bool isWeak = (filename.Length > 1) ? true : false; string completePath = System.IO.Path.Combine("System/Library/Frameworks", filename [0]); this.AddFile(completePath, null, frameworkGroup, "SDKROOT", true, isWeak); } //Debug.Log("Adding files..."); foreach (string filePath in mod.files) { string absoluteFilePath = System.IO.Path.Combine(mod.path, filePath); if (filePath.EndsWith(".framework")) { this.AddFile(absoluteFilePath, null, frameworkGroup, "GROUP", true, false); } else { this.AddFile(absoluteFilePath, null, modGroup); } } //Debug.Log("Adding folders..."); foreach (string folderPath in mod.folders) { // Compile flag 추가 string[] folderName = folderPath.Split('|'); string flag = (folderName.Length > 1) ? folderName [1] : null; string absoluteFolderPath = System.IO.Path.Combine(mod.path, folderName [0]); this.AddFolder(absoluteFolderPath, modGroup, (string[])mod.excludes.ToArray(typeof(string)), true, true, flag); } //Debug.Log("Adding headerpaths..."); foreach (string headerpath in mod.headerpaths) { string absoluteHeaderPath = System.IO.Path.Combine(mod.path, headerpath); this.AddHeaderSearchPaths(absoluteHeaderPath); } //Debug.Log("Configure build settings..."); Hashtable buildSettings = mod.buildSettings; if (buildSettings.ContainsKey("OTHER_LDFLAGS")) { //Debug.Log(" Adding other linker flags..."); ArrayList otherLinkerFlags = (ArrayList)buildSettings ["OTHER_LDFLAGS"]; foreach (string linker in otherLinkerFlags) { string _linker = linker; if (!_linker.StartsWith("-")) { _linker = "-" + _linker; } this.AddOtherLDFlags(_linker); } } // Code Signing 추가 if (buildSettings.ContainsKey("CODE_SIGN_ENTITLEMENTS")) { //Debug.Log(" Adding code signing entitlements..."); string codeSign = System.IO.Path.Combine(mod.path, (string)buildSettings ["CODE_SIGN_ENTITLEMENTS"]); this.AddCodeSigningEntitlements(codeSign); } // Bit Code 추가 if (buildSettings.ContainsKey("ENABLE_BITCODE")) { //Debug.Log(" Adding Enable Bitcode..."); bool bitCode = System.Convert.ToBoolean(buildSettings ["ENABLE_BITCODE"]); this.AddEnableBitCode(bitCode); } if (buildSettings.ContainsKey("GCC_ENABLE_CPP_EXCEPTIONS")) { //Debug.Log(" GCC_ENABLE_CPP_EXCEPTIONS = " + buildSettings ["GCC_ENABLE_CPP_EXCEPTIONS"]); this.GccEnableCppExceptions((string)buildSettings ["GCC_ENABLE_CPP_EXCEPTIONS"]); } if (buildSettings.ContainsKey("GCC_ENABLE_OBJC_EXCEPTIONS")) { //Debug.Log(" GCC_ENABLE_OBJC_EXCEPTIONS = " + buildSettings ["GCC_ENABLE_OBJC_EXCEPTIONS"]); this.GccEnableObjCExceptions(System.Convert.ToBoolean(buildSettings ["GCC_ENABLE_OBJC_EXCEPTIONS"])); } //4.1.0 Hashtable systemCapabilities = mod.systemCapabilities; if (null != systemCapabilities && systemCapabilities.ContainsKey("com.apple.Push")) { this.AddPushSystemCapabilities(System.Convert.ToBoolean(systemCapabilities ["com.apple.Push"])); } this.Consolidate(); }
public void ApplyMod(string pbxmod) { XCMod mod = new XCMod(pbxmod); ApplyMod(mod); }