public static string AddAppExtension(this PBXProject proj, string mainTargetGuid, string name, string bundleId, string infoPlistPath) { string ext = ".appex"; string str = proj.AddTarget(name, ext, "com.apple.product-type.app-extension"); foreach (string name1 in proj.BuildConfigNames()) { string configGuid = proj.BuildConfigByName(str, name1); if (name1.Contains("Debug")) { PBXProjectExtensions.SetDefaultAppExtensionDebugBuildFlags(proj, configGuid); } else { PBXProjectExtensions.SetDefaultAppExtensionReleaseBuildFlags(proj, configGuid); } proj.SetBuildPropertyForConfig(configGuid, "INFOPLIST_FILE", infoPlistPath); proj.SetBuildPropertyForConfig(configGuid, "PRODUCT_BUNDLE_IDENTIFIER", bundleId); } proj.AddSourcesBuildPhase(str); proj.AddResourcesBuildPhase(str); proj.AddFrameworksBuildPhase(str); string sectionGuid = proj.AddCopyFilesBuildPhase(mainTargetGuid, "Embed App Extensions", "", "13"); proj.AddFileToBuildSection(mainTargetGuid, sectionGuid, proj.GetTargetProductFileRef(str)); proj.AddTargetDependency(mainTargetGuid, str); return(str); }
public static string AddWatchApp(this PBXProject proj, string mainTargetGuid, string watchExtensionTargetGuid, string name, string bundleId, string infoPlistPath) { string str1 = proj.AddTarget(name, ".app", "com.apple.product-type.application.watchapp2"); string str2 = proj.nativeTargets[watchExtensionTargetGuid].name.Replace(" ", "_"); foreach (string name1 in proj.BuildConfigNames()) { string configGuid = proj.BuildConfigByName(str1, name1); if (name1.Contains("Debug")) { PBXProjectExtensions.SetDefaultWatchAppDebugBuildFlags(proj, configGuid); } else { PBXProjectExtensions.SetDefaultWatchAppReleaseBuildFlags(proj, configGuid); } proj.SetBuildPropertyForConfig(configGuid, "PRODUCT_BUNDLE_IDENTIFIER", bundleId); proj.SetBuildPropertyForConfig(configGuid, "INFOPLIST_FILE", infoPlistPath); proj.SetBuildPropertyForConfig(configGuid, "IBSC_MODULE", str2); } proj.AddResourcesBuildPhase(str1); string sectionGuid1 = proj.AddCopyFilesBuildPhase(str1, "Embed App Extensions", "", "13"); proj.AddFileToBuildSection(str1, sectionGuid1, proj.GetTargetProductFileRef(watchExtensionTargetGuid)); string sectionGuid2 = proj.AddCopyFilesBuildPhase(mainTargetGuid, "Embed Watch Content", "$(CONTENTS_FOLDER_PATH)/Watch", "16"); proj.AddFileToBuildSection(mainTargetGuid, sectionGuid2, proj.GetTargetProductFileRef(str1)); proj.AddTargetDependency(str1, watchExtensionTargetGuid); proj.AddTargetDependency(mainTargetGuid, str1); return(str1); }
private static void SetEmbedFrameworks(PBXProject proj, string filePath, string fileGuid) { if (embedFrameworksTable != null) { string fileName = Path.GetFileName(filePath); string target = proj.TargetGuidByName(PBXProject.GetUnityTargetName()); ArrayList addList = embedFrameworksTable["+"] as ArrayList; if (addList != null) { foreach (string i in addList) { if (fileName == i) { PBXProjectExtensions.AddFileToEmbedFrameworks(proj, target, fileGuid); } } } } }
public static string AddWatchExtension(this PBXProject proj, string mainTarget, string name, string bundleId, string infoPlistPath) { string targetGuid = proj.AddTarget(name, ".appex", "com.apple.product-type.watchkit2-extension"); foreach (string name1 in proj.BuildConfigNames()) { string configGuid = proj.BuildConfigByName(targetGuid, name1); if (name1.Contains("Debug")) { PBXProjectExtensions.SetDefaultWatchExtensionDebugBuildFlags(proj, configGuid); } else { PBXProjectExtensions.SetDefaultWatchExtensionReleaseBuildFlags(proj, configGuid); } proj.SetBuildPropertyForConfig(configGuid, "PRODUCT_BUNDLE_IDENTIFIER", bundleId); proj.SetBuildPropertyForConfig(configGuid, "INFOPLIST_FILE", infoPlistPath); } proj.AddSourcesBuildPhase(targetGuid); proj.AddResourcesBuildPhase(targetGuid); proj.AddFrameworksBuildPhase(targetGuid); return(targetGuid); }
internal static void SetDefaultWatchAppDebugBuildFlags(this PBXProject proj, string configGuid) { PBXProjectExtensions.SetBuildFlagsFromDict(proj, configGuid, (IEnumerable <KeyValuePair <string, string> >)PBXProjectExtensions.watchAppDebugBuildFlags); }