コード例 #1
0
        public void ApplyMod(XCMod mod)
        {
            PBXGroup modGroup = this.GetGroup(mod.group);

            foreach (XCModFile libRef in mod.libs)
            {
                string completeLibPath;
                if (libRef.sourceTree.Equals("SDKROOT"))
                {
                    completeLibPath = System.IO.Path.Combine("usr/lib", libRef.filePath);
                }
                else
                {
                    completeLibPath = System.IO.Path.Combine(mod.path, libRef.filePath);
                }

                this.AddFile(completeLibPath, modGroup, libRef.sourceTree, true, libRef.isWeak);
            }

            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);
            }

            foreach (string filePath in mod.files)
            {
                string absoluteFilePath = System.IO.Path.Combine(mod.path, filePath);
                this.AddFile(absoluteFilePath, modGroup);
            }

            foreach (string folderPath in mod.folders)
            {
                string absoluteFolderPath = AddXcodeQuotes(System.IO.Path.Combine(mod.path, folderPath));
                this.AddFolder(absoluteFolderPath, modGroup, (string[])mod.excludes.ToArray(  ));
            }


            foreach (string headerpath in mod.headerpaths)
            {
                string absoluteHeaderPath = AddXcodeQuotes(System.IO.Path.Combine(mod.path, headerpath));
                this.AddHeaderSearchPaths(absoluteHeaderPath);
            }

            //if(mod.librarysearchpaths != null) {
            foreach (string librarypath in mod.librarysearchpaths)
            {
                string absolutePath = AddXcodeQuotes(System.IO.Path.Combine(mod.path, librarypath));
                this.AddLibrarySearchPaths(absolutePath);
            }
            //}

            if (mod.frameworksearchpath != null)
            {
                foreach (string frameworksearchpath in mod.frameworksearchpath)
                {
                    string absoluteHeaderPath = AddXcodeQuotes(System.IO.Path.Combine(mod.path, frameworksearchpath));
                    this.AddFrameworkSearchPaths(absoluteHeaderPath);
                }
            }

            this.Consolidate();
        }
コード例 #2
0
ファイル: XCProject.cs プロジェクト: 3nan/unity_practice
		public void ApplyMod( XCMod mod )
		{
			PBXGroup modGroup = this.GetGroup( mod.group );
			
			foreach( XCModFile libRef in mod.libs ) {
				string completeLibPath;
				if(libRef.sourceTree.Equals("SDKROOT")) {
					completeLibPath = System.IO.Path.Combine( "usr/lib", libRef.filePath );
				}
				else {
					completeLibPath = System.IO.Path.Combine( mod.path, libRef.filePath );
				}
					
				this.AddFile( completeLibPath, modGroup, libRef.sourceTree, true, libRef.isWeak );
			}
			
			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 );
			}
			
			foreach( string filePath in mod.files ) {
				string absoluteFilePath = System.IO.Path.Combine( mod.path, filePath );
				this.AddFile( absoluteFilePath, modGroup );
			}
			
			foreach( string folderPath in mod.folders ) {
				string absoluteFolderPath = AddXcodeQuotes(System.IO.Path.Combine( mod.path, folderPath ));
				this.AddFolder( absoluteFolderPath, modGroup, (string[])mod.excludes.ToArray(  ) );
			}
			
			
			foreach( string headerpath in mod.headerpaths ) {
				string absoluteHeaderPath = AddXcodeQuotes( System.IO.Path.Combine( mod.path, headerpath ) );
				this.AddHeaderSearchPaths( absoluteHeaderPath );
			}
			
			//if(mod.librarysearchpaths != null) {
			foreach( string librarypath in mod.librarysearchpaths ) {
				string absolutePath = AddXcodeQuotes(System.IO.Path.Combine( mod.path, librarypath ));
				this.AddLibrarySearchPaths( absolutePath );
			}
			//}
			
			if(mod.frameworksearchpath != null)
			{
				foreach( string frameworksearchpath in mod.frameworksearchpath ) {
					string absoluteHeaderPath = AddXcodeQuotes(System.IO.Path.Combine( mod.path, frameworksearchpath ));
					this.AddFrameworkSearchPaths( absoluteHeaderPath );
				}
			}
			
			this.Consolidate();
		}
コード例 #3
0
        public void ApplyMod(string rootPath, string pbxmod)
        {
            XCMod mod = new XCMod(rootPath, pbxmod);

            ApplyMod(mod);
        }
コード例 #4
0
ファイル: XCProject.cs プロジェクト: 3nan/unity_practice
		public void ApplyMod( string rootPath, string pbxmod )
		{
			XCMod mod = new XCMod( rootPath, pbxmod );
			ApplyMod( mod );
		}