Пример #1
0
        public static PBXResourcesBuildPhaseData Create()
        {
            var res = new PBXResourcesBuildPhaseData();

            res.guid = PBXGUID.Generate();
            res.SetPropertyString("isa", "PBXResourcesBuildPhase");
            res.SetPropertyString("buildActionMask", "2147483647");
            res.files = new List <string>();
            res.SetPropertyString("runOnlyForDeploymentPostprocessing", "0");
            return(res);
        }
Пример #2
0
        // Returns the guid of the new target
        internal string AddAppExtension(string mainTarget, string name, string infoPlistPath)
        {
            string ext       = ".appex";
            var    newTarget = CreateNewTarget(name, ext, "com.apple.product-type.app-extension");

            SetDefaultAppExtensionReleaseBuildFlags(buildConfigs[BuildConfigByName(newTarget.guid, "Release")], infoPlistPath);
            SetDefaultAppExtensionDebugBuildFlags(buildConfigs[BuildConfigByName(newTarget.guid, "Debug")], infoPlistPath);

            var sourcesBuildPhase = PBXSourcesBuildPhaseData.Create();

            sources.AddEntry(sourcesBuildPhase);
            newTarget.phases.AddGUID(sourcesBuildPhase.guid);

            var resourcesBuildPhase = PBXResourcesBuildPhaseData.Create();

            resources.AddEntry(resourcesBuildPhase);
            newTarget.phases.AddGUID(resourcesBuildPhase.guid);

            var frameworksBuildPhase = PBXFrameworksBuildPhaseData.Create();

            frameworks.AddEntry(frameworksBuildPhase);
            newTarget.phases.AddGUID(frameworksBuildPhase.guid);

            var copyFilesBuildPhase = PBXCopyFilesBuildPhaseData.Create("Embed App Extensions", "13");

            copyFiles.AddEntry(copyFilesBuildPhase);
            nativeTargets[mainTarget].phases.AddGUID(copyFilesBuildPhase.guid);

            var containerProxy = PBXContainerItemProxyData.Create(project.project.guid, "1", newTarget.guid, name);

            containerItems.AddEntry(containerProxy);

            var targetDependency = PBXTargetDependencyData.Create(newTarget.guid, containerProxy.guid);

            targetDependencies.AddEntry(targetDependency);

            nativeTargets[mainTarget].dependencies.AddGUID(targetDependency.guid);

            var buildAppCopy = PBXBuildFileData.CreateFromFile(FindFileGuidByProjectPath("Products/" + name + ext), false, "");

            BuildFilesAdd(mainTarget, buildAppCopy);
            copyFilesBuildPhase.files.AddGUID(buildAppCopy.guid);

            AddFile(infoPlistPath, name + "/Supporting Files/Info.plist", PBXSourceTree.Source);

            return(newTarget.guid);
        }
Пример #3
0
        internal string AddAppExtension(string mainTarget, string name, string infoPlistPath)
        {
            string ext = ".appex";
            PBXNativeTargetData data = this.CreateNewTarget(name, ext, "com.apple.product-type.app-extension");

            this.SetDefaultAppExtensionReleaseBuildFlags(this.buildConfigs[this.BuildConfigByName(data.guid, "Release")], infoPlistPath);
            this.SetDefaultAppExtensionDebugBuildFlags(this.buildConfigs[this.BuildConfigByName(data.guid, "Debug")], infoPlistPath);
            PBXSourcesBuildPhaseData data2 = PBXSourcesBuildPhaseData.Create();

            this.sources.AddEntry(data2);
            data.phases.AddGUID(data2.guid);
            PBXResourcesBuildPhaseData data3 = PBXResourcesBuildPhaseData.Create();

            this.resources.AddEntry(data3);
            data.phases.AddGUID(data3.guid);
            PBXFrameworksBuildPhaseData data4 = PBXFrameworksBuildPhaseData.Create();

            this.frameworks.AddEntry(data4);
            data.phases.AddGUID(data4.guid);
            PBXCopyFilesBuildPhaseData data5 = PBXCopyFilesBuildPhaseData.Create("Embed App Extensions", "13");

            this.copyFiles.AddEntry(data5);
            this.nativeTargets[mainTarget].phases.AddGUID(data5.guid);
            PBXContainerItemProxyData data6 = PBXContainerItemProxyData.Create(this.project.project.guid, "1", data.guid, name);

            this.containerItems.AddEntry(data6);
            PBXTargetDependencyData data7 = PBXTargetDependencyData.Create(data.guid, data6.guid);

            this.targetDependencies.AddEntry(data7);
            this.nativeTargets[mainTarget].dependencies.AddGUID(data7.guid);
            PBXBuildFileData buildFile = PBXBuildFileData.CreateFromFile(this.FindFileGuidByProjectPath("Products/" + name + ext), false, "");

            this.BuildFilesAdd(mainTarget, buildFile);
            data5.files.AddGUID(buildFile.guid);
            this.AddFile(infoPlistPath, name + "/Supporting Files/Info.plist", PBXSourceTree.Source);
            return(data.guid);
        }