예제 #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(MacPath(completeLibPath), modGroup, libRef.sourceTree, true, libRef.isWeak);
            }

            PBXGroup frameworkGroup = this.GetGroup("Frameworks");

            if (mod.frameworks != null)
            {
                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(MacPath(completePath), frameworkGroup, "SDKROOT", true, isWeak);
                }
            }

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

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

            if (mod.headerpaths != null)
            {
                foreach (string headerpath in mod.headerpaths)
                {
                    string absoluteHeaderPath = System.IO.Path.Combine(mod.path, headerpath);
                    this.AddHeaderSearchPaths(AddXcodeQuotes(MacPath(headerpath.Contains("$(SRCROOT)") ? headerpath : absoluteHeaderPath)));
                }
            }

            if (mod.librarysearchpaths != null)
            {
                foreach (string librarypath in mod.librarysearchpaths)
                {
                    string absolutePath = System.IO.Path.Combine(mod.path, librarypath);
                    this.AddLibrarySearchPaths(AddXcodeQuotes(MacPath(librarypath.Contains("$(SRCROOT)") ? librarypath : absolutePath)));
                }
            }

            if (mod.frameworksearchpath != null)
            {
                foreach (string frameworksearchpath in mod.frameworksearchpath)
                {
                    string absoluteHeaderPath = System.IO.Path.Combine(mod.path, frameworksearchpath);
                    this.AddFrameworkSearchPaths(AddXcodeQuotes(MacPath(frameworksearchpath.Contains("$(SRCROOT)") ? frameworksearchpath : absoluteHeaderPath)));
                }
            }

            this.Consolidate();
        }
예제 #2
0
        public void ApplyMod(string rootPath, string pbxmod)
        {
            XCMod mod = new XCMod(rootPath, pbxmod);

            ApplyMod(mod);
        }