示例#1
0
 private void SetDefaultAppExtensionReleaseBuildFlags(XCBuildConfigurationData 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)");
     config.AddProperty("LD_RUNPATH_SEARCH_PATHS", "@executable_path/Frameworks");
     config.AddProperty("LD_RUNPATH_SEARCH_PATHS", "@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");
 }
示例#2
0
        internal PBXNativeTargetData CreateNewTarget(string name, string ext, string type)
        {
            // create build configurations
            var releaseBuildConfig = XCBuildConfigurationData.Create("Release");

            buildConfigs.AddEntry(releaseBuildConfig);

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

            buildConfigs.AddEntry(debugBuildConfig);

            var buildConfigList = XCConfigurationListData.Create();

            configs.AddEntry(buildConfigList);
            buildConfigList.buildConfigs.AddGUID(releaseBuildConfig.guid);
            buildConfigList.buildConfigs.AddGUID(debugBuildConfig.guid);

            // create build file reference
            string fullName       = name + ext;
            var    productFileRef = AddFile(fullName, "Products/" + fullName, PBXSourceTree.Build);
            var    newTarget      = PBXNativeTargetData.Create(name, productFileRef, type, buildConfigList.guid);

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

            return(newTarget);
        }
        internal PBXNativeTargetData CreateNewTarget(string name, string ext, string type)
        {
            // create build configurations
            var releaseBuildConfig = XCBuildConfigurationData.Create("Release");
            releaseBuildConfig.SetProperty("FRAMEWORK_SEARCH_PATHS","$(inherited) $(PROJECT_DIR)/Frameworks/GetSocial/Plugins/iOS");
            buildConfigs.AddEntry(releaseBuildConfig);

            var releaseForRunningBuildConfig = XCBuildConfigurationData.Create("ReleaseForRunning");
            releaseForRunningBuildConfig.SetProperty("FRAMEWORK_SEARCH_PATHS","$(inherited) $(PROJECT_DIR)/Frameworks/GetSocial/Plugins/iOS");
            buildConfigs.AddEntry(releaseForRunningBuildConfig);

            var releaseForProfilingBuildConfig = XCBuildConfigurationData.Create("ReleaseForProfiling");
            releaseForProfilingBuildConfig.SetProperty("FRAMEWORK_SEARCH_PATHS","$(inherited) $(PROJECT_DIR)/Frameworks/GetSocial/Plugins/iOS");
            buildConfigs.AddEntry(releaseForProfilingBuildConfig);

            var debugBuildConfig = XCBuildConfigurationData.Create("Debug");
            debugBuildConfig.SetProperty("FRAMEWORK_SEARCH_PATHS","$(inherited) $(PROJECT_DIR)/Frameworks/GetSocial/Plugins/iOS");
            buildConfigs.AddEntry(debugBuildConfig);

            var buildConfigList = XCConfigurationListData.Create();
            configs.AddEntry(buildConfigList);
            buildConfigList.buildConfigs.AddGUID(releaseBuildConfig.guid);
            buildConfigList.buildConfigs.AddGUID(releaseForRunningBuildConfig.guid);
            buildConfigList.buildConfigs.AddGUID(releaseForProfilingBuildConfig.guid);
            buildConfigList.buildConfigs.AddGUID(debugBuildConfig.guid);

            // create build file reference
            string fullName = name + ext;
            var productFileRef = AddFile(fullName, "Products/" + fullName, PBXSourceTree.Build);
            var newTarget = PBXNativeTargetData.Create(name, productFileRef, type, buildConfigList.guid);
            nativeTargets.AddEntry(newTarget);
            project.project.targets.Add(newTarget.guid);

            return newTarget;
        }
        // name should be either release or debug
        public static XCBuildConfigurationData Create(string name)
        {
            var res = new XCBuildConfigurationData();

            res.guid = PBXGUID.Generate();
            res.SetPropertyString("isa", "XCBuildConfiguration");
            res.SetPropertyString("name", name);
            return(res);
        }
示例#5
0
        public void AddDynamicFrameworkToProject(string targetGuid, string frameworkPathInProject)
        {
            var fileGuid = FindFileGuidByProjectPath(frameworkPathInProject);

            if (fileGuid == null)
            {
                Debug.LogError("Framework not found: " + frameworkPathInProject);
                return;
            }
            // add file reference as embed framework
            var embedFrameworkFileData = FindEmbeddedFramework(fileGuid);

            if (embedFrameworkFileData == null)
            {
                embedFrameworkFileData = PBXBuildFileData.CreateFromFramework(fileGuid);
                BuildFilesAdd(targetGuid, embedFrameworkFileData);
            }

            // add "Embed Frameworks" section
            var embedFrameworksSection = FindEmbeddedFrameworkSection();

            if (embedFrameworksSection == null)
            {
                embedFrameworksSection = PBXCopyFilesBuildPhaseData.Create("Embed Frameworks", "10");
                copyFiles.AddEntry(embedFrameworksSection);
            }

            var frameworkAlreadyAdded = false;

            foreach (var fileEntry in embedFrameworksSection.files)
            {
                if (fileEntry == embedFrameworkFileData.guid)
                {
                    frameworkAlreadyAdded = true;
                }
            }
            if (!frameworkAlreadyAdded)
            {
                embedFrameworksSection.files.AddGUID(embedFrameworkFileData.guid);
            }

            // add "Embed Frameworks" section to "Build phases"
            var targetPhases = nativeTargets[targetGuid].phases;

            if (!targetPhases.Contains(embedFrameworksSection.guid))
            {
                targetPhases.AddGUID(embedFrameworksSection.guid);
            }
            foreach (var buildConfigEntry in buildConfigs.GetEntries())
            {
                XCBuildConfigurationData configurationData = buildConfigEntry.Value;
                configurationData.AddProperty("LD_RUNPATH_SEARCH_PATHS", "$(inherited) @executable_path/Frameworks");
            }
        }
 public void CheckRuntimeSearchPath() {
     foreach (var buildConfigEntry in buildConfigs.GetEntries())
     {
         XCBuildConfigurationData configurationData = buildConfigEntry.Value;
         configurationData.RemoveProperty("LD_RUNPATH_SEARCH_PATHS");
         configurationData.AddProperty("LD_RUNPATH_SEARCH_PATHS","$(inherited)");
         configurationData.AddProperty("LD_RUNPATH_SEARCH_PATHS","/usr/lib/swift");
         configurationData.AddProperty("LD_RUNPATH_SEARCH_PATHS", "@executable_path/Frameworks");
         configurationData.AddProperty("LD_RUNPATH_SEARCH_PATHS", "@loader_path/Frameworks");
     }
 }