UnityEditor.iOS.Xcode.PBXProject.AddBuildPropertyForConfig C# (CSharp) Method

AddBuildPropertyForConfig() public method

public AddBuildPropertyForConfig ( IEnumerable configGuids, string name, string value ) : void
configGuids IEnumerable
name string
value string
return void
        public void AddBuildPropertyForConfig(IEnumerable<string> configGuids, string name, string value)
        {
            foreach (string str in configGuids)
            {
                this.AddBuildPropertyForConfig(str, name, value);
            }
        }

Same methods

PBXProject::AddBuildPropertyForConfig ( string configGuid, string name, string value ) : void

Usage Example

コード例 #1
0
    public static void OnPostProcessBuild(BuildTarget target, string pathToBuiltProject)
    {
        Debug.LogWarning("IphoneX Fiter");
        if (target != BuildTarget.iOS)
        {
            Debug.LogWarning("Target is not iPhone. XCodePostProcess will not run");
            return;
        }
        // Create a new project object from build target
        UnityEditor.iOS.Xcode.PBXProject project = new UnityEditor.iOS.Xcode.PBXProject();
        string configFilePath = UnityEditor.iOS.Xcode.PBXProject.GetPBXProjectPath(pathToBuiltProject);

        project.ReadFromFile(configFilePath);
        string targetGuid = project.TargetGuidByName("Unity-iPhone");
        string debug      = project.BuildConfigByName(targetGuid, "Debug");
        string release    = project.BuildConfigByName(targetGuid, "Release");

        project.AddBuildPropertyForConfig(debug, "CODE_SIGN_RESOURCE_RULES_PATH", "$(SDKROOT)/ResourceRules.plist");
        project.AddBuildPropertyForConfig(release, "CODE_SIGN_RESOURCE_RULES_PATH", "$(SDKROOT)/ResourceRules.plist");

        project.AddFrameworkToProject(targetGuid, "SystemConfiguration.framework", true);
        project.AddFrameworkToProject(targetGuid, "Security.framework", true);
        project.AddFrameworkToProject(targetGuid, "libz.tbd", true);
        project.AddFrameworkToProject(targetGuid, "libc++.tbd", true);

        project.SetBuildProperty(targetGuid, "ENABLE_BITCODE", "NO");

        project.WriteToFile(configFilePath);

        EditSuitIpXCode(pathToBuiltProject);
    }
PBXProject