/// <summary> /// https://docs.unity3d.com/Manual/UnityCloudBuildManifest.html /// </summary> private static CloudBuildArgs LoadCloudBuildArgs() { var manifestAsset = (TextAsset)Resources.Load(ManifestFileName); var cloudBuildArgs = new CloudBuildArgs(); if (manifestAsset) { var manifest = JsonConvert.DeserializeObject <Dictionary <string, object> >(manifestAsset.text); cloudBuildArgs.BuildNumber = int.Parse(manifest["buildNumber"].ToString()); cloudBuildArgs.BundleId = manifest["bundleId"].ToString(); cloudBuildArgs.ProjectId = manifest["projectId"].ToString(); cloudBuildArgs.ScmBranch = manifest["scmBranch"].ToString(); cloudBuildArgs.CloudBuildTargetName = manifest["cloudBuildTargetName"].ToString(); cloudBuildArgs.ScmCommitId = manifest["scmCommitId"].ToString(); } return(cloudBuildArgs); }
public static void PreExport(DummyManifest manifest) { #endif GameLog.Log("UNI BUILD: START PreExport COMMAND"); args = new CloudBuildArgs( manifest.GetValue <int>("buildNumber"), manifest.GetValue <string>("bundleId"), manifest.GetValue <string>("projectId"), manifest.GetValue <string>("scmCommitId"), manifest.GetValue <string>("scmBranch"), manifest.GetValue <string>("cloudBuildTargetName") ); GameLog.Log($"UNI BUILD: ARGS\n {args}"); var parameters = CreateCommandParameters(); var builder = new UnityPlayerBuilder(); var guid = "%BUILDMAP-GUID%"; var assetPath = AssetDatabase.GUIDToAssetPath(guid); var configuration = AssetDatabase.LoadAssetAtPath <UniBuildCommandsMap>(assetPath); builder.ExecuteCommands <UnityPreBuildCommand>(parameters, configuration, x => x.Execute(parameters)); }