// #region Files // // // /// <summary> // /// Returns all file resources in the project, as an array of `XCSourceFile` objects. // /// </summary> // /// <returns> // /// The files. // /// </returns> // public ArrayList GetFiles() // { // return null; // } // // /// <summary> // /// Returns the project file with the specified key, or nil. // /// </summary> // /// <returns> // /// The file with key. // /// </returns> // /// <param name='key'> // /// Key. // /// </param> // public XCSourceFile GetFileWithKey( string key ) // { // return null; // } // // /// <summary> // /// Returns the project file with the specified name, or nil. If more than one project file matches the specified name, // /// which one is returned is undefined. // /// </summary> // /// <returns> // /// The file with name. // /// </returns> // /// <param name='name'> // /// Name. // /// </param> // public XCSourceFile GetFileWithName( string name ) // { // return null; // } // // /// <summary> // /// Returns all header files in the project, as an array of `XCSourceFile` objects. // /// </summary> // /// <returns> // /// The header files. // /// </returns> // public ArrayList GetHeaderFiles() // { // return null; // } // // /** // * Returns all implementation obj-c implementation files in the project, as an array of `XCSourceFile` objects. // */ // public ArrayList GetObjectiveCFiles() // { // return null; // } // // /** // * Returns all implementation obj-c++ implementation files in the project, as an array of `XCSourceFile` objects. // */ // public ArrayList GetObjectiveCPlusPlusFiles() // { // return null; // } // // /** // * Returns all the xib files in the project, as an array of `XCSourceFile` objects. // */ // public ArrayList GetXibFiles() // { // return null; // // } // // public ArrayList getImagePNGFiles() // { // return null; // } // // #endregion // #region Groups // /** // * Lists the groups in an xcode project, returning an array of `PBXGroup` objects. // */ // public PBXList groups { // get { // return null; // } // } // // /** // * Returns the root (top-level) group. // */ // public PBXGroup rootGroup { // get { // return null; // } // } // // /** // * Returns the root (top-level) groups, if there are multiple. An array of rootGroup if there is only one. // */ // public ArrayList rootGroups { // get { // return null; // } // } // // /** // * Returns the group with the given key, or nil. // */ // public PBXGroup GetGroupWithKey( string key ) // { // return null; // } // // /** // * Returns the group with the specified display name path - the directory relative to the root group. Eg Source/Main // */ // public PBXGroup GetGroupWithPathFromRoot( string path ) // { // return null; // } // // /** // * Returns the parent group for the group or file with the given key; // */ // public PBXGroup GetGroupForGroupMemberWithKey( string key ) // { // return null; // } // // /** // * Returns the parent group for the group or file with the source file // */ // public PBXGroup GetGroupWithSourceFile( XCSourceFile sourceFile ) // { // return null; // } // // #endregion // #region Target // // /** // * Lists the targets in an xcode project, returning an array of `XCTarget` objects. // */ // public ArrayList targets { // get { // return null; // } // } // // /** // * Returns the target with the specified name, or nil. // */ // public XCTarget GetTargetWithName( string name ) // { // return null; // } // // #endregion // #region Configurations // // /** // * Returns the target with the specified name, or nil. // */ // public Dictionary<string, string> configurations { // get { // return null; // } // } // // public Dictionary<string, string> GetConfigurationWithName( string name ) // { // return null; // } // // public XCBuildConfigurationList defaultConfiguration { // get { // return null; // } // } // // #endregion #region Mods public void ApplyMod(string pbxmod) { XCMod mod = new XCMod(pbxmod); 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, 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, 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, frameworkGroup, "GROUP", true, false); else this.AddFile( absoluteFilePath, modGroup ); } //Debug.Log( "Adding folders..." ); foreach( string folderPath in mod.folders ) { string absoluteFolderPath = System.IO.Path.Combine( mod.path, folderPath ); this.AddFolder( absoluteFolderPath, modGroup, (string[])mod.excludes.ToArray( typeof(string) ) ); } //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 ); } } 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( (string) buildSettings["GCC_ENABLE_OBJC_EXCEPTIONS"] ); } this.Consolidate(); }
public void ApplyMod( string pbxmod ) { XCMod mod = new XCMod( pbxmod ); 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, 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, 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, frameworkGroup, "GROUP", true, false); } else { this.AddFile(absoluteFilePath, modGroup); } } //Debug.Log( "Adding folders..." ); foreach (string folderPath in mod.folders) { string absoluteFolderPath = System.IO.Path.Combine(mod.path, folderPath); this.AddFolder(absoluteFolderPath, modGroup, (string[])mod.excludes.ToArray(typeof(string))); } //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); } } 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((string)buildSettings["GCC_ENABLE_OBJC_EXCEPTIONS"]); } this.Consolidate(); }