UnityEditor.iOS.Xcode.PBXProject.BuildConfigByName C# (CSharp) 메소드

BuildConfigByName() 공개 메소드

public BuildConfigByName ( string targetGuid, string name ) : string
targetGuid string
name string
리턴 string
        public string BuildConfigByName(string targetGuid, string name)
        {
            PBXNativeTargetData data = this.nativeTargets[targetGuid];
            foreach (string str in (IEnumerable<string>) this.configs[data.buildConfigList].buildConfigs)
            {
                XCBuildConfigurationData data2 = this.buildConfigs[str];
                if ((data2 != null) && (data2.name == name))
                {
                    return data2.guid;
                }
            }
            return null;
        }

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);
    }
All Usage Examples Of UnityEditor.iOS.Xcode.PBXProject::BuildConfigByName
PBXProject