示例#1
0
		public void ApplyMod( XCMod mod )
		{	
			PBXGroup modGroup = this.GetGroup( mod.group );
			
			Debug.Log( "Adding libraries..." );
			#pragma warning disable 0219
			PBXGroup librariesGroup = this.GetGroup( "Libraries" );
			#pragma warning restore 0219
			foreach( XCModFile libRef in mod.libs ) {
				string completeLibPath = System.IO.Path.Combine( "usr/lib", libRef.filePath );
				this.AddFile( completeLibPath, modGroup, "SDKROOT", true, libRef.isWeak );
			}

			PBXGroup frameworkGroup = this.GetGroup( "Frameworks" );
			if (mod.frameworks != null) {
				Debug.Log( "Adding 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 );
				}
			}

			if (mod.files != null) {
				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 );
				}
			}

			if (mod.folders != null) {
				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) ) );
				}
			}

			if (mod.headerpaths != null) {
				Debug.Log( "Adding headerpaths..." );
				foreach( string headerpath in mod.headerpaths ) {
					string absoluteHeaderPath = System.IO.Path.Combine( mod.path, headerpath );
					this.AddHeaderSearchPaths( absoluteHeaderPath );
				}
			}

			if (mod.buildSettings != null) {
				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();
		}
示例#2
0
        public void ApplyMod(XCMod mod)
        {
            PBXGroup modGroup = this.GetGroup(mod.group);

            Debug.Log("Adding libraries...");
                        #pragma warning disable 0219
            PBXGroup librariesGroup = this.GetGroup("Libraries");
                        #pragma warning restore 0219
            foreach (XCModFile libRef in mod.libs)
            {
                string completeLibPath = System.IO.Path.Combine("usr/lib", libRef.filePath);
                this.AddFile(completeLibPath, modGroup, "SDKROOT", true, libRef.isWeak);
            }

            PBXGroup frameworkGroup = this.GetGroup("Frameworks");
            if (mod.frameworks != null)
            {
                Debug.Log("Adding 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);
                }
            }

            if (mod.files != null)
            {
                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);
                    }
                }
            }

            if (mod.folders != null)
            {
                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)));
                }
            }

            if (mod.headerpaths != null)
            {
                Debug.Log("Adding headerpaths...");
                foreach (string headerpath in mod.headerpaths)
                {
                    string absoluteHeaderPath = System.IO.Path.Combine(mod.path, headerpath);
                    this.AddHeaderSearchPaths(absoluteHeaderPath);
                }
            }

            if (mod.buildSettings != null)
            {
                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();
        }
示例#3
0
		public void ApplyMod( string pbxmod )
		{
			XCMod mod = new XCMod( pbxmod );
			ApplyMod( mod );
		}
示例#4
0
        public void ApplyMod(string pbxmod)
        {
            XCMod mod = new XCMod(pbxmod);

            ApplyMod(mod);
        }