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

GetPBXProjectPath() public static method

public static GetPBXProjectPath ( string buildPath ) : string
buildPath string
return string
        public static string GetPBXProjectPath(string buildPath)
        {
            return PBXPath.Combine(buildPath, "Unity-iPhone.xcodeproj/project.pbxproj");
        }

Usage Example

Esempio n. 1
0
    public static void OnPostprocessBuild(string xcodePath, string configPath)
    {
        pluginPath = configPath.Replace("XcodeSetting.json", "");
        string     projPath = PBXProject.GetPBXProjectPath(xcodePath);
        PBXProject proj     = new PBXProject();

        proj.ReadFromString(File.ReadAllText(projPath));

        string        plistPath = xcodePath + "/Info.plist";
        PlistDocument plist     = new PlistDocument();

        plist.ReadFromString(File.ReadAllText(plistPath));
        PlistElementDict rootDict = plist.root;

        //string target = proj.TargetGuidByName(PBXProject.GetUnityTargetName());
        //string target = proj.TargetGuidByName("UnityFramework");
        //string productName = proj.GetBuildPropertyForAnyConfig(target, "PRODUCT_NAME");
        string entitlementFilePath          = Path.Combine(PBXProject.GetUnityTargetName(), "usdk.entitlements");
        ProjectCapabilityManager pcbManager = new ProjectCapabilityManager(proj, projPath, entitlementFilePath, PBXProject.GetUnityTargetName());

        //读取配置文件
        string    json  = File.ReadAllText(configPath);
        Hashtable table = json.hashtableFromJson();

        embedFrameworksTable = table.SGet <Hashtable>("embedframeworks");

        //plist
        SetPlist(proj, rootDict, table.SGet <Hashtable>("plist"));
        plist.WriteToFile(plistPath);

        //lib
        SetLibs(proj, table.SGet <Hashtable>("libs"));
        //framework
        SetFrameworks(proj, table.SGet <Hashtable>("frameworks"));
        //building setting
        SetBuildProperties(proj, table.SGet <Hashtable>("properties"));
        SetShellScriptBuildPhase(proj, table.SGet <Hashtable>("shellscript"));
        //复制文件
        CopyFiles(proj, xcodePath, table.SGet <Hashtable>("files"));
        //复制文件夹
        CopyFolders(proj, xcodePath, table.SGet <Hashtable>("folders"));
        //文件编译符号
        SetFilesCompileFlag(proj, table.SGet <Hashtable>("filesCompileFlag"));
        //加入能力
        SetCapabilitys(pcbManager, table.SGet <Hashtable>("capabilitys"));
        //写入
        File.WriteAllText(projPath, proj.WriteToString());

        Console.WriteLine("***Info.plist*****\n" + File.ReadAllText(plistPath));
    }
All Usage Examples Of UnityEditor.iOS.Xcode.PBXProject::GetPBXProjectPath
PBXProject