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