当前位置: 首页>>代码示例>>C#>>正文


C# System.Uri.MakeRelativeUri方法代码示例

本文整理汇总了C#中System.Uri.MakeRelativeUri方法的典型用法代码示例。如果您正苦于以下问题:C# System.Uri.MakeRelativeUri方法的具体用法?C# System.Uri.MakeRelativeUri怎么用?C# System.Uri.MakeRelativeUri使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Uri的用法示例。


在下文中一共展示了System.Uri.MakeRelativeUri方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DebugTest2

        static void DebugTest2()
        {
            string path1 = "/Users/Elyn/Projects/UnityPlugins/Unity Sandbox Project/Assets/Modules/GameCenter/Editor/iOS/GameCenterManager.m";
            string path2 = "/Users/Elyn/Projects/UnityPlugins/Unity Sandbox Project/XCode/.";

            System.Uri fileURI = new System.Uri( path1 );
            System.Uri rootURI = new System.Uri( path2 );
            Debug.Log( fileURI.MakeRelativeUri( rootURI ).ToString() );
            Debug.Log( rootURI.MakeRelativeUri( fileURI ).ToString() );

            //			string projectPath = Path.Combine( Directory.GetParent( Application.dataPath ).ToString(), "XCode" );

            //			string[] files = System.IO.Directory.GetFiles( projectPath, "Info.plist" );
            //			string contents = System.IO.File.OpenText( files[0] ).ReadToEnd();

            //			string[] projects = System.IO.Directory.GetDirectories( projectPath, "*.xcodeproj" );
            //			string projPath = System.IO.Path.Combine( projects[0], "project.pbxproj" );
            //			string contents = System.IO.File.OpenText( projPath ).ReadToEnd();
            //			Debug.Log( System.IO.File.OpenText( projPath ).ReadToEnd );

            //			PBXParser parser = new PBXParser();
            //			Hashtable test = (Hashtable)parser.Decode( contents );
            //			PBXDictionary test = parser.Decode( contents );
            //			Debug.Log( MiniJSON.jsonEncode( test ) );
            //			Debug.Log( test + " - " + test.Count );
            //			Debug.Log( parser.Encode( test ) );
        }
开发者ID:darktable,项目名称:XCodeEditor-for-Unity,代码行数:27,代码来源:XCodeEditorMenu.cs

示例2: getRelativePathTo

 public static string getRelativePathTo(this string path, string basePath)
 {
     System.Uri uri1 = new System.Uri(path);
     System.Uri uri2 = new System.Uri(basePath);
     System.Uri relativeUri = uri2.MakeRelativeUri(uri1);
     return relativeUri.ToString();
 }
开发者ID:polycular,项目名称:oekogotschi,代码行数:7,代码来源:PathExtensions.cs

示例3: AddFile

        public PBXDictionary AddFile( string filePath, PBXGroup parent = null, string tree = "SOURCE_ROOT", bool createBuildFiles = true, bool weak = false )
        {
            PBXDictionary results = new PBXDictionary();
            string absPath = string.Empty;

            if( Path.IsPathRooted( filePath ) ) {
                absPath = filePath;
            }
            else if( tree.CompareTo( "SDKROOT" ) != 0) {
                absPath = Path.Combine( Application.dataPath, filePath );
            }

            if( !( File.Exists( absPath ) || Directory.Exists( absPath ) ) && tree.CompareTo( "SDKROOT" ) != 0 ) {
                Debug.Log( "Missing file: " + filePath );
                return results;
            }
            else if( tree.CompareTo( "SOURCE_ROOT" ) == 0 ) {
                System.Uri fileURI = new System.Uri( absPath );
                System.Uri rootURI = new System.Uri( ( projectRootPath + "/." ) );
                filePath = rootURI.MakeRelativeUri( fileURI ).ToString();
            }

            if( parent == null ) {
                parent = _rootGroup;
            }

            //Check if there is already a file
            PBXFileReference fileReference = GetFile( System.IO.Path.GetFileName( filePath ) );
            if( fileReference != null ) {
                Debug.LogWarning("File is already exists: " + filePath);
                return null;
            }

            fileReference = new PBXFileReference( filePath, (TreeEnum)System.Enum.Parse( typeof(TreeEnum), tree ) );
            parent.AddChild( fileReference );
            fileReferences.Add( fileReference );
            results.Add( fileReference.guid, fileReference );

            //Create a build file for reference
            if( !string.IsNullOrEmpty( fileReference.buildPhase ) && createBuildFiles ) {

                switch( fileReference.buildPhase ) {
                    case "PBXFrameworksBuildPhase":
                        foreach( KeyValuePair<string, PBXFrameworksBuildPhase> currentObject in frameworkBuildPhases ) {
                            BuildAddFile(fileReference,currentObject,weak);
                        }
                        if ( !string.IsNullOrEmpty( absPath ) && ( tree.CompareTo( "SOURCE_ROOT" ) == 0 )) {
                            string libraryPath = Path.Combine( "$(SRCROOT)", Path.GetDirectoryName( filePath ) );
                            if (File.Exists(absPath)) {
                                this.AddLibrarySearchPaths( new PBXList( libraryPath ) );
                            } else {
                                this.AddFrameworkSearchPaths( new PBXList( libraryPath ) );
                            }

                        }
                        break;
                    case "PBXResourcesBuildPhase":
                        foreach( KeyValuePair<string, PBXResourcesBuildPhase> currentObject in resourcesBuildPhases ) {
                            BuildAddFile(fileReference,currentObject,weak);
                        }
                        break;
                    case "PBXShellScriptBuildPhase":
                        foreach( KeyValuePair<string, PBXShellScriptBuildPhase> currentObject in shellScriptBuildPhases ) {
                            BuildAddFile(fileReference,currentObject,weak);
                        }
                        break;
                    case "PBXSourcesBuildPhase":
                        foreach( KeyValuePair<string, PBXSourcesBuildPhase> currentObject in sourcesBuildPhases ) {
                            BuildAddFile(fileReference,currentObject,weak);
                        }
                        break;
                    case "PBXCopyFilesBuildPhase":
                        foreach( KeyValuePair<string, PBXCopyFilesBuildPhase> currentObject in copyBuildPhases ) {
                            BuildAddFile(fileReference,currentObject,weak);
                        }
                        break;
                    case null:
                        Debug.LogWarning( "File Not Support: " + filePath );
                        break;
                    default:
                        Debug.LogWarning( "File Not Support." );
                        return null;
                }
            }
            return results;
        }
开发者ID:nsdevaraj,项目名称:UnityIOS,代码行数:86,代码来源:XCProject.cs

示例4: AddFile

//		public PBXDictionary<PBXBuildPhase> GetBuildPhase( string buildPhase )
//		{
//			switch( buildPhase ) {
//				case "PBXFrameworksBuildPhase":
//					return (PBXDictionary<PBXBuildPhase>)frameworkBuildPhases;
//				case "PBXResourcesBuildPhase":
//					return (PBXDictionary<PBXBuildPhase>)resourcesBuildPhases;
//				case "PBXShellScriptBuildPhase":
//					return (PBXDictionary<PBXBuildPhase>)shellScriptBuildPhases;
//				case "PBXSourcesBuildPhase":
//					return (PBXDictionary<PBXBuildPhase>)sourcesBuildPhases;
//				case "PBXCopyFilesBuildPhase":
//					return (PBXDictionary<PBXBuildPhase>)copyBuildPhases;
//				default:
//					return default(T);
//			}
//		}
		
		public PBXDictionary AddFile( string filePath, PBXGroup parent = null, string tree = "SOURCE_ROOT", bool createBuildFiles = true, bool weak = false )
		{
			PBXDictionary results = new PBXDictionary();
			string absPath = string.Empty;
			
			if( Path.IsPathRooted( filePath ) ) {
				absPath = filePath;
//				Debug.Log( "Is rooted: " + absPath );
			}
			else if( tree.CompareTo( "SDKROOT" ) != 0) {
				absPath = Path.Combine( Application.dataPath.Replace("Assets", ""), filePath );
//				Debug.Log( "RElative: " + absPath );
			}
			
			if( !( File.Exists( absPath ) || Directory.Exists( absPath ) ) && tree.CompareTo( "SDKROOT" ) != 0 ) {
				Debug.Log( "Missing file: " + absPath + " > " + filePath );
				return results;
			}
			else if( tree.CompareTo( "SOURCE_ROOT" ) == 0 || tree.CompareTo( "GROUP" ) == 0 ) {
				System.Uri fileURI = new System.Uri( absPath );
				System.Uri rootURI = new System.Uri( ( projectRootPath + "/." ) );
				filePath = rootURI.MakeRelativeUri( fileURI ).ToString();
			}
//			else {
//				tree = "<absolute>";
//				Debug.Log( "3: " + filePath );
//			}
//			Debug.Log( "Add file result path: " + filePath );
			
			if( parent == null ) {
				parent = _rootGroup;
			}
			
			// TODO: Aggiungere controllo se file già presente
			PBXFileReference fileReference = GetFile( System.IO.Path.GetFileName( filePath ) );	
			if( fileReference != null ) {
//				Debug.Log( "File già presente." );
				return null;
			}
			
			fileReference = new PBXFileReference( filePath, (TreeEnum)System.Enum.Parse( typeof(TreeEnum), tree ) );
			parent.AddChild( fileReference );
			fileReferences.Add( fileReference );
			results.Add( fileReference.guid, fileReference );

			//Create a build file for reference
			if( !string.IsNullOrEmpty( fileReference.buildPhase ) && createBuildFiles ) {
//				PBXDictionary<PBXBuildPhase> currentPhase = GetBuildPhase( fileReference.buildPhase );
				PBXBuildFile buildFile;
				switch( fileReference.buildPhase ) {
					case "PBXFrameworksBuildPhase":
						foreach( KeyValuePair<string, PBXFrameworksBuildPhase> currentObject in frameworkBuildPhases ) {
							buildFile = new PBXBuildFile( fileReference, weak );
							buildFiles.Add( buildFile );
							currentObject.Value.AddBuildFile( buildFile );
						}

						if ( !string.IsNullOrEmpty( absPath ) && File.Exists(absPath) && tree.CompareTo( "SOURCE_ROOT" ) == 0 ) {
							//Debug.LogError(absPath);
							string libraryPath = Path.Combine( "$(SRCROOT)", Path.GetDirectoryName( filePath ) );
							this.AddLibrarySearchPaths( new PBXList(libraryPath) );
						}
						else if (!string.IsNullOrEmpty( absPath ) && Directory.Exists(absPath) && absPath.EndsWith(".framework") && tree.CompareTo("GROUP") == 0) { // Annt: Add framework search path for FacebookSDK
							string frameworkPath = Path.Combine( "$(SRCROOT)", Path.GetDirectoryName( filePath ) );
							this.AddFrameworkSearchPaths(new PBXList(frameworkPath));
						}
						break;
					case "PBXResourcesBuildPhase":
						foreach( KeyValuePair<string, PBXResourcesBuildPhase> currentObject in resourcesBuildPhases ) {
							buildFile = new PBXBuildFile( fileReference, weak );
							buildFiles.Add( buildFile );
							currentObject.Value.AddBuildFile( buildFile );
						}
						break;
					case "PBXShellScriptBuildPhase":
						foreach( KeyValuePair<string, PBXShellScriptBuildPhase> currentObject in shellScriptBuildPhases ) {
							buildFile = new PBXBuildFile( fileReference, weak );
							buildFiles.Add( buildFile );
							currentObject.Value.AddBuildFile( buildFile );
						}
						break;
					case "PBXSourcesBuildPhase":
//.........这里部分代码省略.........
开发者ID:smclallen,项目名称:Galactic_Parcel_Service,代码行数:101,代码来源:XCProject.cs

示例5: AddLocFolder

        // We support neither recursing into nor bundles contained inside loc folders
        public bool AddLocFolder( string folderPath, PBXGroup parent = null, string[] exclude = null, bool createBuildFile = true)
        {
            DirectoryInfo sourceDirectoryInfo = new DirectoryInfo( folderPath );

            if( exclude == null )
                exclude = new string[] {};

            if( parent == null )
                parent = rootGroup;

            // Create group as needed
            System.Uri projectFolderURI = new System.Uri( projectFileInfo.DirectoryName );
            System.Uri locFolderURI = new System.Uri( folderPath );
            var relativePath = projectFolderURI.MakeRelativeUri( locFolderURI ).ToString();
            PBXGroup newGroup = GetGroup( sourceDirectoryInfo.Name, relativePath, parent );

            // Add loc region to project
            string nom = sourceDirectoryInfo.Name;
            string region = nom.Substring(0, nom.Length - ".lproj".Length);
            project.AddRegion(region);

            // Adding files.
            string regexExclude = string.Format( @"{0}", string.Join( "|", exclude ) );
            foreach( string file in Directory.GetFiles( folderPath ) ) {
                if( Regex.IsMatch( file, regexExclude ) ) {
                    continue;
                }

                // Add a variant group for the language as well
                var variant = new PBXVariantGroup(System.IO.Path.GetFileName( file ), null, "GROUP");
                variantGroups.Add(variant);

                // The group gets a reference to the variant, not to the file itself
                newGroup.AddChild(variant);

                AddFile( file, variant, "GROUP", createBuildFile );
            }

            modified = true;
            return modified;
        }
开发者ID:gmosdk,项目名称:unity,代码行数:42,代码来源:XCProject.cs

示例6: SelectRDAFilesFolder

        private void SelectRDAFilesFolder(string path)
        {
            if (!System.IO.Directory.Exists(path)) {
                MessageBox.Show(this, "The given path is not a directory.", "Error");
                return;
            }

            this.viewModel.RDAFilesFolder = path;
            System.Uri pathUri = new System.Uri(path);

            IEnumerable<string> containerPaths = System.IO.Directory.GetFiles(this.viewModel.RDAFilesFolder, @"data*.rda");
            containerPaths = AnnoRDA.Loader.ContainerDirectoryLoader.SortContainerPaths(containerPaths);
            this.viewModel.RDAFileList.Items.Clear();
            foreach (string filePath in containerPaths) {
                System.Uri filePathUri = new System.Uri(filePath);
                System.Uri relativeFilePathUri = pathUri.MakeRelativeUri(filePathUri);

                this.viewModel.RDAFileList.Items.Add(new RDAFileListItem(true, filePath, relativeFilePathUri.OriginalString));
            }
        }
开发者ID:lysannschlegel,项目名称:RDAExplorer,代码行数:20,代码来源:MainWindow.xaml.cs

示例7: AddFile

    public PBXDictionary AddFile(string filePath, PBXGroup parent = null, string tree = "SOURCE_ROOT", bool createBuildFiles = true, bool weak = false)
    {
        PBXDictionary results = new PBXDictionary();
        string absPath = string.Empty;

        if (Path.IsPathRooted(filePath))
        {
            absPath = filePath;
        }
        else if (tree.CompareTo("SDKROOT") != 0)
        {
            absPath = Path.Combine(Application.dataPath, filePath);
        }

        if (tree.CompareTo("SOURCE_ROOT") == 0)
        {
            System.Uri fileURI = new System.Uri(absPath);
            System.Uri rootURI = new System.Uri((projectRootPath + "/."));
            filePath = rootURI.MakeRelativeUri(fileURI).ToString();
        }

        if (parent == null)
        {
            parent = _rootGroup;
        }

        // TODO: Aggiungere controllo se file già presente
        PBXFileReference fileReference = GetFile(System.IO.Path.GetFileName(filePath));
        if (fileReference != null)
        {
            return null;
        }

        fileReference = new PBXFileReference(filePath, (TreeEnum) System.Enum.Parse(typeof(TreeEnum), tree));
        parent.AddChild(fileReference);
        fileReferences.Add(fileReference);
        results.Add(fileReference.guid, fileReference);

        // Find test target
        PBXNativeTarget nativeTestTarget = null;
        foreach (KeyValuePair<string, PBXNativeTarget> currentObject in nativeTargets)
        {
            PBXNativeTarget nativeTargetObj = currentObject.Value;

            if (nativeTargetObj != null && nativeTargetObj.data.ContainsKey("name"))
            {
                string name = (string) nativeTargetObj.data["name"];

                if (name != null && name.Contains("Unity-iPhone Tests"))
                {
                    nativeTestTarget = nativeTargetObj;
                    break;
                }
            }
        }

        //Create a build file for reference
        if (!string.IsNullOrEmpty(fileReference.buildPhase) && createBuildFiles)
        {
            PBXBuildFile buildFile;
            switch (fileReference.buildPhase)
            {
            case "PBXFrameworksBuildPhase":
                foreach (KeyValuePair<string, PBXFrameworksBuildPhase> currentObject in frameworkBuildPhases)
                {
                    if (nativeTestTarget == null || !nativeTestTarget.HasBuildphase(currentObject.Key.Split(' ')[0]))
                    {
                        buildFile = new PBXBuildFile(fileReference, weak);
                        buildFiles.Add(buildFile);
                        currentObject.Value.AddBuildFile(buildFile);
                    }
                }
                if (!string.IsNullOrEmpty(absPath) && (tree.CompareTo("SOURCE_ROOT") == 0) && File.Exists(absPath))
                {
                    string libraryPath = Path.Combine("$(SRCROOT)", Path.GetDirectoryName(filePath));
                    this.AddLibrarySearchPaths(new PBXList(libraryPath));
                }
                break;
            case "PBXResourcesBuildPhase":
                foreach (KeyValuePair<string, PBXResourcesBuildPhase> currentObject in resourcesBuildPhases)
                {
                    if (nativeTestTarget == null || !nativeTestTarget.HasBuildphase(currentObject.Key.Split(' ')[0]))
                    {
                        buildFile = new PBXBuildFile(fileReference, weak);
                        buildFiles.Add(buildFile);
                        currentObject.Value.AddBuildFile(buildFile);
                    }
                }
                break;
            case "PBXShellScriptBuildPhase":
                foreach (KeyValuePair<string, PBXShellScriptBuildPhase> currentObject in shellScriptBuildPhases)
                {
                    if (nativeTestTarget == null || !nativeTestTarget.HasBuildphase(currentObject.Key.Split(' ')[0]))
                    {
                        buildFile = new PBXBuildFile(fileReference, weak);
                        buildFiles.Add(buildFile);
                        currentObject.Value.AddBuildFile(buildFile);
                    }
                }
                break;
//.........这里部分代码省略.........
开发者ID:jose-castillo,项目名称:SoundPuzzle,代码行数:101,代码来源:XCProject.cs

示例8: AddFile

		public PBXDictionary AddFile( string filePath, PBXGroup parent = null, string tree = "SOURCE_ROOT", bool createBuildFiles = true, bool weak = false, string compilerFlags = null)
		{
			//Debug.Log("AddFile " + filePath + ", " + parent + ", " + tree + ", " + (createBuildFiles? "TRUE":"FALSE") + ", " + (weak? "TRUE":"FALSE") ); 
			
			PBXDictionary results = new PBXDictionary();
			if (filePath == null) {
				Debug.LogError ("AddFile called with null filePath");
				return results;
			}

			string absPath = string.Empty;
			
			if( Path.IsPathRooted( filePath ) ) {
				Debug.Log( "Path is Rooted" );
				absPath = filePath;
			}
			else if( tree.CompareTo( "SDKROOT" ) != 0) {
				absPath = Path.Combine( Application.dataPath, filePath );
			}
			
			if( !( File.Exists( absPath ) || Directory.Exists( absPath ) ) && tree.CompareTo( "SDKROOT" ) != 0 ) {
				Debug.Log( "Missing file: " + filePath );
				return results;
			}
			else if( tree.CompareTo( "SOURCE_ROOT" ) == 0 ) {
				Debug.Log( "Source Root File" );
				System.Uri fileURI = new System.Uri( absPath );
				System.Uri rootURI = new System.Uri( ( projectRootPath + "/." ) );
				filePath = rootURI.MakeRelativeUri( fileURI ).ToString();
			}
			else if( tree.CompareTo("GROUP") == 0) {
				Debug.Log( "Group File" );
				filePath = Path.GetFileName( filePath );
			}

			if( parent == null ) {
				parent = _rootGroup;
			}
			
			//Check if there is already a file
			PBXFileReference fileReference = GetFile( Path.GetFileName( filePath ) );	
			if( fileReference != null ) 
			{
				//Updating internal data with this call.
				fileReference.GuessFileType();	
			}
			else
			{
				fileReference = new PBXFileReference( filePath, (TreeEnum)System.Enum.Parse( typeof(TreeEnum), tree ) );
			}

			// Adding compiler flag
			if (!string.IsNullOrEmpty(compilerFlags))
			{
				fileReference.compilerFlags	= compilerFlags;
			}

			parent.AddChild( fileReference );
			fileReferences.Add( fileReference );
			results.Add( fileReference.guid, fileReference );
			
			//Create a build file for reference
			if( !string.IsNullOrEmpty( fileReference.buildPhase ) && createBuildFiles ) {
				
				switch( fileReference.buildPhase ) {
					case "PBXFrameworksBuildPhase":
						foreach( KeyValuePair<string, PBXFrameworksBuildPhase> currentObject in frameworkBuildPhases ) {
							BuildAddFile(fileReference,currentObject,weak);
						}
						if ( !string.IsNullOrEmpty( absPath ) && ( tree.CompareTo( "SOURCE_ROOT" ) == 0 )) {
							string libraryPath = Path.Combine( "$(SRCROOT)", Path.GetDirectoryName( filePath ) );
							if (File.Exists(absPath)) {
								this.AddLibrarySearchPaths( new PBXList( libraryPath ) ); 
							} else {
								this.AddFrameworkSearchPaths( new PBXList( libraryPath ) );  
							}
							
						}
						break;
					case "PBXResourcesBuildPhase":
						foreach( KeyValuePair<string, PBXResourcesBuildPhase> currentObject in resourcesBuildPhases ) {
							Debug.Log( "Adding Resources Build File" );
							BuildAddFile(fileReference,currentObject,weak);
						}
						break;
					case "PBXShellScriptBuildPhase":
						foreach( KeyValuePair<string, PBXShellScriptBuildPhase> currentObject in shellScriptBuildPhases ) {
							Debug.Log( "Adding Script Build File" );
							BuildAddFile(fileReference,currentObject,weak);
						}
						break;
					case "PBXSourcesBuildPhase":
						foreach( KeyValuePair<string, PBXSourcesBuildPhase> currentObject in sourcesBuildPhases ) {
							Debug.Log( "Adding Source Build File" );
							BuildAddFile(fileReference,currentObject,weak);
						}
						break;
					case "PBXCopyFilesBuildPhase":
						foreach( KeyValuePair<string, PBXCopyFilesBuildPhase> currentObject in copyBuildPhases ) {
							Debug.Log( "Adding Copy Files Build Phase" );
//.........这里部分代码省略.........
开发者ID:noahzaozao,项目名称:UnityAdmobAppEventDemo,代码行数:101,代码来源:XCProject.cs

示例9: AddFile

		public PBXDictionary AddFile( string filePath, PBXGroup parent = null, string tree = "SOURCE_ROOT", bool createBuildFiles = true, bool weak = false )
		{
			PBXDictionary results = new PBXDictionary();
			string absPath = string.Empty;
			
			if( Path.IsPathRooted( filePath ) ) {
				absPath = filePath;
			}
			else if( tree.CompareTo( "SDKROOT" ) != 0) {
				absPath = Path.Combine( Application.dataPath.Replace("Assets", ""), filePath );
			}
			
			if( !( File.Exists( absPath ) || Directory.Exists( absPath ) ) && tree.CompareTo( "SDKROOT" ) != 0 ) {
				Debug.Log( "Missing file: " + absPath + " > " + filePath );
				return results;
			}
			else if( tree.CompareTo( "SOURCE_ROOT" ) == 0 || tree.CompareTo( "GROUP" ) == 0 ) {
				System.Uri fileURI = new System.Uri( absPath );
				System.Uri rootURI = new System.Uri( ( projectRootPath + "/." ) );
				filePath = rootURI.MakeRelativeUri( fileURI ).ToString();
			}
			
			if( parent == null ) {
				parent = _rootGroup;
			}
			
			// TODO: Aggiungere controllo se file già presente
			PBXFileReference fileReference = GetFile( System.IO.Path.GetFileName( filePath ) );	
			if( fileReference != null ) {
				return null;
			}
			
			fileReference = new PBXFileReference( filePath, (TreeEnum)System.Enum.Parse( typeof(TreeEnum), tree ) );
			parent.AddChild( fileReference );
			fileReferences.Add( fileReference );
			results.Add( fileReference.guid, fileReference );

			//Create a build file for reference
			if( !string.IsNullOrEmpty( fileReference.buildPhase ) && createBuildFiles ) {
				PBXBuildFile buildFile;
				switch( fileReference.buildPhase ) {
					case "PBXFrameworksBuildPhase":
						foreach( KeyValuePair<string, PBXFrameworksBuildPhase> currentObject in frameworkBuildPhases ) {
							buildFile = new PBXBuildFile( fileReference, weak );
							buildFiles.Add( buildFile );
							currentObject.Value.AddBuildFile( buildFile );
						}

						if ( !string.IsNullOrEmpty( absPath ) && File.Exists(absPath) && tree.CompareTo( "SOURCE_ROOT" ) == 0 ) {
							//Debug.LogError(absPath);
							string libraryPath = Path.Combine( "$(SRCROOT)", Path.GetDirectoryName( filePath ) );
							this.AddLibrarySearchPaths( new PBXList(libraryPath) );
						}
						else if (!string.IsNullOrEmpty( absPath ) && Directory.Exists(absPath) && absPath.EndsWith(".framework") && tree.CompareTo("GROUP") == 0) { // Annt: Add framework search path for FacebookSDK
							string frameworkPath = Path.Combine( "$(SRCROOT)", Path.GetDirectoryName( filePath ) );
							this.AddFrameworkSearchPaths(new PBXList(frameworkPath));
						}
						break;
					case "PBXResourcesBuildPhase":
						foreach( KeyValuePair<string, PBXResourcesBuildPhase> currentObject in resourcesBuildPhases ) {
							buildFile = new PBXBuildFile( fileReference, weak );
							buildFiles.Add( buildFile );
							currentObject.Value.AddBuildFile( buildFile );
						}
						break;
					case "PBXShellScriptBuildPhase":
						foreach( KeyValuePair<string, PBXShellScriptBuildPhase> currentObject in shellScriptBuildPhases ) {
							buildFile = new PBXBuildFile( fileReference, weak );
							buildFiles.Add( buildFile );
							currentObject.Value.AddBuildFile( buildFile );
						}
						break;
					case "PBXSourcesBuildPhase":
						foreach( KeyValuePair<string, PBXSourcesBuildPhase> currentObject in sourcesBuildPhases ) {
							buildFile = new PBXBuildFile( fileReference, weak );
							buildFiles.Add( buildFile );
							currentObject.Value.AddBuildFile( buildFile );
						}
						break;
					case "PBXCopyFilesBuildPhase":
						foreach( KeyValuePair<string, PBXCopyFilesBuildPhase> currentObject in copyBuildPhases ) {
							buildFile = new PBXBuildFile( fileReference, weak );
							buildFiles.Add( buildFile );
							currentObject.Value.AddBuildFile( buildFile );
						}
						break;
					case null:
						Debug.LogWarning( "fase non supportata null" );
						break;
					default:
						Debug.LogWarning( "fase non supportata def" );
						return null;
				}
			}
			
			return results;
		}
开发者ID:ashishsfb,项目名称:Save-The-Kitty,代码行数:97,代码来源:XCProject.cs


注:本文中的System.Uri.MakeRelativeUri方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。