Esempio n. 1
0
 void SetDefaultAppExtensionReleaseBuildFlags(XCBuildConfiguration config, string infoPlistPath)
 {
     config.AddProperty("ALWAYS_SEARCH_USER_PATHS", "NO");
     config.AddProperty("CLANG_CXX_LANGUAGE_STANDARD", "gnu++0x");
     config.AddProperty("CLANG_CXX_LIBRARY", "libc++");
     config.AddProperty("CLANG_ENABLE_MODULES", "YES");
     config.AddProperty("CLANG_ENABLE_OBJC_ARC", "YES");
     config.AddProperty("CLANG_WARN_BOOL_CONVERSION", "YES");
     config.AddProperty("CLANG_WARN_CONSTANT_CONVERSION", "YES");
     config.AddProperty("CLANG_WARN_DIRECT_OBJC_ISA_USAGE", "YES_ERROR");
     config.AddProperty("CLANG_WARN_EMPTY_BODY", "YES");
     config.AddProperty("CLANG_WARN_ENUM_CONVERSION", "YES");
     config.AddProperty("CLANG_WARN_INT_CONVERSION", "YES");
     config.AddProperty("CLANG_WARN_OBJC_ROOT_CLASS", "YES_ERROR");
     config.AddProperty("CLANG_WARN_UNREACHABLE_CODE", "YES");
     config.AddProperty("CLANG_WARN__DUPLICATE_METHOD_MATCH", "YES");
     config.AddProperty("COPY_PHASE_STRIP", "YES");
     config.AddProperty("ENABLE_NS_ASSERTIONS", "NO");
     config.AddProperty("ENABLE_STRICT_OBJC_MSGSEND", "YES");
     config.AddProperty("GCC_C_LANGUAGE_STANDARD", "gnu99");
     config.AddProperty("GCC_WARN_64_TO_32_BIT_CONVERSION", "YES");
     config.AddProperty("GCC_WARN_ABOUT_RETURN_TYPE", "YES_ERROR");
     config.AddProperty("GCC_WARN_UNDECLARED_SELECTOR", "YES");
     config.AddProperty("GCC_WARN_UNINITIALIZED_AUTOS", "YES_AGGRESSIVE");
     config.AddProperty("GCC_WARN_UNUSED_FUNCTION", "YES");
     config.AddProperty("INFOPLIST_FILE", infoPlistPath);
     config.AddProperty("IPHONEOS_DEPLOYMENT_TARGET", "8.0");
     config.AddProperty("LD_RUNPATH_SEARCH_PATHS", "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks");
     config.AddProperty("MTL_ENABLE_DEBUG_INFO", "NO");
     config.AddProperty("PRODUCT_NAME", "$(TARGET_NAME)");
     config.AddProperty("SKIP_INSTALL", "YES");
     config.AddProperty("VALIDATE_PRODUCT", "YES");
 }
Esempio n. 2
0
        // name should be either release or debug
        public static XCBuildConfiguration Create(string name)
        {
            var res = new XCBuildConfiguration();

            res.guid = PBXGUID.Generate();
            res.m_Properties["isa"]  = "XCBuildConfiguration";
            res.m_Properties["name"] = name;
            return(res);
        }
 // name should be either release or debug
 public static XCBuildConfiguration Create(string name)
 {
     var res = new XCBuildConfiguration();
     res.guid = PBXGUID.Generate();
     res.m_Properties["isa"] = "XCBuildConfiguration";
     res.m_Properties["name"] = name;
     return res;
 }
 private void SetDefaultAppExtensionReleaseBuildFlags(XCBuildConfiguration config, string infoPlistPath)
 {
     config.AddProperty("ALWAYS_SEARCH_USER_PATHS", "NO");
     config.AddProperty("CLANG_CXX_LANGUAGE_STANDARD", "gnu++0x");
     config.AddProperty("CLANG_CXX_LIBRARY", "libc++");
     config.AddProperty("CLANG_ENABLE_MODULES", "YES");
     config.AddProperty("CLANG_ENABLE_OBJC_ARC", "YES");
     config.AddProperty("CLANG_WARN_BOOL_CONVERSION", "YES");
     config.AddProperty("CLANG_WARN_CONSTANT_CONVERSION", "YES");
     config.AddProperty("CLANG_WARN_DIRECT_OBJC_ISA_USAGE", "YES_ERROR");
     config.AddProperty("CLANG_WARN_EMPTY_BODY", "YES");
     config.AddProperty("CLANG_WARN_ENUM_CONVERSION", "YES");
     config.AddProperty("CLANG_WARN_INT_CONVERSION", "YES");
     config.AddProperty("CLANG_WARN_OBJC_ROOT_CLASS", "YES_ERROR");
     config.AddProperty("CLANG_WARN_UNREACHABLE_CODE", "YES");
     config.AddProperty("CLANG_WARN__DUPLICATE_METHOD_MATCH", "YES");
     config.AddProperty("COPY_PHASE_STRIP", "YES");
     config.AddProperty("ENABLE_NS_ASSERTIONS", "NO");
     config.AddProperty("ENABLE_STRICT_OBJC_MSGSEND", "YES");
     config.AddProperty("GCC_C_LANGUAGE_STANDARD", "gnu99");
     config.AddProperty("GCC_WARN_64_TO_32_BIT_CONVERSION", "YES");
     config.AddProperty("GCC_WARN_ABOUT_RETURN_TYPE", "YES_ERROR");
     config.AddProperty("GCC_WARN_UNDECLARED_SELECTOR", "YES");
     config.AddProperty("GCC_WARN_UNINITIALIZED_AUTOS", "YES_AGGRESSIVE");
     config.AddProperty("GCC_WARN_UNUSED_FUNCTION", "YES");
     config.AddProperty("INFOPLIST_FILE", infoPlistPath);
     config.AddProperty("IPHONEOS_DEPLOYMENT_TARGET", "8.0");
     config.AddProperty("LD_RUNPATH_SEARCH_PATHS", "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks");
     config.AddProperty("MTL_ENABLE_DEBUG_INFO", "NO");
     config.AddProperty("PRODUCT_NAME", "$(TARGET_NAME)");
     config.AddProperty("SKIP_INSTALL", "YES");
     config.AddProperty("VALIDATE_PRODUCT", "YES");
 }
Esempio n. 5
0
        // Returns the guid of the new target
        internal string AddAppExtension(string mainTarget, string name, string infoPlistPath)
        {
            const string ext            = ".appex";
            string       fullName       = name + ext;
            var          productFileRef = PBXFileReference.CreateFromFile("Products/" + fullName, "Products/" + fullName,
                                                                          PBXSourceTree.Group);
            var releaseBuildConfig = XCBuildConfiguration.Create("Release");

            buildConfigs.AddEntry(releaseBuildConfig);
            SetDefaultAppExtensionReleaseBuildFlags(releaseBuildConfig, infoPlistPath);

            var debugBuildConfig = XCBuildConfiguration.Create("Debug");

            buildConfigs.AddEntry(debugBuildConfig);
            SetDefaultAppExtensionDebugBuildFlags(debugBuildConfig, infoPlistPath);

            var buildConfigList = XCConfigurationList.Create();

            configs.AddEntry(buildConfigList);
            buildConfigList.buildConfig.Add(releaseBuildConfig.guid);
            buildConfigList.buildConfig.Add(debugBuildConfig.guid);

            var newTarget = PBXNativeTarget.Create(name, productFileRef.guid, "com.apple.product-type.app-extension", buildConfigList.guid);

            nativeTargets.AddEntry(newTarget);
            project.project.targets.Add(newTarget.guid);

            var sourcesBuildPhase = PBXSourcesBuildPhase.Create();

            sources.AddEntry(sourcesBuildPhase);
            newTarget.phase.Add(sourcesBuildPhase.guid);

            var resourcesBuildPhase = PBXResourcesBuildPhase.Create();

            resources.AddEntry(resourcesBuildPhase);
            newTarget.phase.Add(resourcesBuildPhase.guid);

            var frameworksBuildPhase = PBXFrameworksBuildPhase.Create();

            frameworks.AddEntry(frameworksBuildPhase);
            newTarget.phase.Add(frameworksBuildPhase.guid);

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

            copyFiles.AddEntry(copyFilesBuildPhase);
            nativeTargets[mainTarget].phase.Add(copyFilesBuildPhase.guid);

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

            containerItems.AddEntry(containerProxy);

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

            targetDependencies.AddEntry(targetDependency);

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

            AddFile(fullName, "Products/" + fullName, PBXSourceTree.Build);
            var buildAppCopy = PBXBuildFile.CreateFromFile(FindFileGuidByProjectPath("Products/" + fullName), false, "");

            buildFiles.AddEntry(buildAppCopy);
            copyFilesBuildPhase.file.Add(buildAppCopy.guid);

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

            return(newTarget.guid);
        }