Exemplo n.º 1
0
        public void AddShellScriptFromCustomPath(string absolutePath)
        {
            //添加shell-script
            string shellPath = UtilsPath.GetRelativePath(xcodePath, absolutePath);
            string fileName  = Path.GetFileName(absolutePath);

            pbxProj.AppendShellScriptBuildPhase(targetGuid, "Run Script " + fileName, "/bin/sh", shellPath);
        }
Exemplo n.º 2
0
        public void AddFileResourceFromCustomPath(string absolutePath)
        {
            //添加资源文件(.bundle,.png)到build phases
            string pngReferencePath = UtilsPath.GetRelativePath(xcodePath, absolutePath);
            string fileName         = Path.GetFileName(absolutePath);
            string pngReference     = pbxProj.AddFile(pngReferencePath, fileName, PBXSourceTree.Source);

            pbxProj.AddFileToBuild(targetGuid, pngReference);
        }
Exemplo n.º 3
0
        public void AddFolderResourceFromCustomPath(string folderAbsolutePath)
        {
            //添加文件夹到build phases
            string folderReferencePath = UtilsPath.GetRelativePath(xcodePath, folderAbsolutePath);
            string lastName            = Path.GetFileName(folderAbsolutePath);
            string folderReference     = pbxProj.AddFolderReference(folderReferencePath, lastName, PBXSourceTree.Group);

            pbxProj.AddFileToBuild(targetGuid, folderReference);
        }
Exemplo n.º 4
0
        public void AddFrameworkFromCustomPath(string absolutePath)
        {
            //添加自定义路径的framework
            string frameworkReferencePath = UtilsPath.GetRelativePath(xcodePath, absolutePath);
            string fileName           = Path.GetFileName(absolutePath);
            string path               = PBXPath.GetDirectory(frameworkReferencePath) + "/**";
            string frameworkReference = pbxProj.AddFile(frameworkReferencePath, "Frameworks/" + fileName, PBXSourceTree.Group);

            pbxProj.AddFileToBuild(targetGuid, frameworkReference);
            pbxProj.AddBuildProperty(targetGuid, "FRAMEWORK_SEARCH_PATHS", path);
        }
Exemplo n.º 5
0
        public void AddComplieFileFromCustomPath(string absolutePath, List <string> compileFlags)
        {
            //添加编译代码文件
            string compileFileReferencePath = UtilsPath.GetRelativePath(xcodePath, absolutePath);
            string fileName             = Path.GetFileName(absolutePath);
            string compileFileReference = pbxProj.AddFile(compileFileReferencePath, fileName, PBXSourceTree.Group);

            pbxProj.AddFileToBuild(targetGuid, compileFileReference);

            /*
             * List<string> list = new List<string>();
             * list.Add("-fno-objc-arc");
             * */
            pbxProj.SetCompileFlagsForFile(targetGuid, compileFileReference, compileFlags);
        }
Exemplo n.º 6
0
        public void AddDynamicFrameworkFromCustomPath(string absolutePath)
        {
            //添加自定义路径的EmbeddedFramework

            pbxProj.SetBuildProperty(targetGuid, "LD_RUNPATH_SEARCH_PATHS", "$(inherited) @executable_path/Frameworks");

            string frameworkReferencePath = UtilsPath.GetRelativePath(xcodePath, absolutePath);
            string path               = PBXPath.GetDirectory(frameworkReferencePath) + "/**";
            string fileName           = Path.GetFileName(absolutePath);
            string frameworkReference = pbxProj.AddFile(frameworkReferencePath, "Frameworks/" + fileName, PBXSourceTree.Group);

            pbxProj.AddFileToBuild(targetGuid, frameworkReference);

            pbxProj.AddDynamicFrameworkToProject(targetGuid, frameworkReferencePath, "Frameworks/" + fileName);

            pbxProj.AddBuildProperty(targetGuid, "FRAMEWORK_SEARCH_PATHS", path);
        }