コード例 #1
0
    [PostProcessBuildAttribute(1080)]    //To make sure the other scripts are executed.
    public static void OnPostprocessBuild(BuildTarget target, string pathToBuildProject)
    {
        if (pathToBuildProject.StartsWith("./") || !pathToBuildProject.StartsWith("/"))           // Fix three erroneous path cases on Unity 5.4f03
        {
            pathToBuildProject = Path.Combine(Application.dataPath.Replace("Assets", ""), pathToBuildProject.Replace("./", ""));
        }
        else if (pathToBuildProject.Contains("./"))
        {
            pathToBuildProject = pathToBuildProject.Replace("./", "");
        }

        UnityEngine.Debug.Log("----Executing post process build phase----");
        PBXModifier mod     = new PBXModifier();
        string      pbxproj = Path.Combine(pathToBuildProject, "Unity-iPhone.xcodeproj/project.pbxproj");

        if (!File.Exists(pbxproj))
        {
            return;
        }

        var lines = mod.applyToAssetLibrary(pbxproj);

        File.WriteAllLines(pbxproj, lines);

        UnityEngine.Debug.Log("----Finished executing post process build phase");

        ProcessInfoPList(pathToBuildProject);
    }
コード例 #2
0
    public static void OnPostProcessBuild(BuildTarget target, string path)
    {
        if (BuildTarget.iOS == target)
        {
            PBXModifier mod     = new PBXModifier();
            string      pbxproj = Path.Combine(path, "Unity-iPhone.xcodeproj/project.pbxproj");
            if (!File.Exists(pbxproj))
            {
                return;
            }
            var lines = mod.applyTo(pbxproj);

            File.WriteAllLines(pbxproj, lines);
        }
    }
コード例 #3
0
    [PostProcessBuild(100)]    //To make sure the other scripts are executed.
    public static void OnPostprocessBuild(BuildTarget target, string pathToBuildProject)
    {
        UnityEngine.Debug.Log("----Executing post process build phase----");
        PBXModifier mod     = new PBXModifier();
        string      pbxproj = Path.Combine(pathToBuildProject, "Unity-iPhone.xcodeproj/project.pbxproj");

        if (!File.Exists(pbxproj))
        {
            return;
        }

        var lines = mod.applyTo(pbxproj);

        File.WriteAllLines(pbxproj, lines);

        UnityEngine.Debug.Log("----Finished executing post process build phase");
    }