Ejemplo n.º 1
0
        /// <summary>
        /// Unity Cloud Build Pre-Build Command.
        /// </summary>
        /// <param name="manifest"></param>
#if UNITY_CLOUD_BUILD
        public static void Prebuild(UnityEngine.CloudBuild.BuildManifestObject manifest)
        {
            Debug.Log("Starting pre-export changes and cleanup...");
            PlayerSettings.bundleVersion += string.Format(" {0} Build #{1}",
                                                          manifest.GetValue <string>("cloudBuildTargetName"),
                                                          manifest.GetValue <string>("buildNumber"));
            Debug.Log($"Changed version to {PlayerSettings.bundleVersion}");
Ejemplo n.º 2
0
        public static void PreCloudBuildExport(UnityEngine.CloudBuild.BuildManifestObject manifest)
        {
            Debug.Log($"{nameof(PreCloudBuildExport)} invoked");
            BuildMetaInfoGenerator.PreCloudBuildExport(manifest);

            BuildAssetBundles();
        }
Ejemplo n.º 3
0
        public static void PreExport(UnityEngine.CloudBuild.BuildManifestObject manifest)
        {
            string buildNumber = manifest.GetValue("buildNumber", "0");

            Debug.LogWarning("Setting build number to " + buildNumber);
            PlayerSettings.Android.bundleVersionCode = int.Parse(buildNumber);
            PlayerSettings.iOS.buildNumber           = buildNumber;
        }
Ejemplo n.º 4
0
        public static void PreExport(UnityEngine.CloudBuild.BuildManifestObject manifest)
        {
            Debug.LogWarning("BuildProcessor PreExport json: " + manifest.ToJson());
            Debug.LogWarning($"BuildProcessor cloudBuildTargetName: { manifest.GetValue<string>("cloudBuildTargetName")}");
            Debug.LogWarning($"BuildProcessor buildNumber: { manifest.GetValue<string>("buildNumber")}");
            Debug.LogWarning($"BuildProcessor projectId: { manifest.GetValue<string>("projectId")}");

            BuildNumber          = manifest.GetValue <string>("buildNumber");
            CloudBuildTargetName = manifest.GetValue <string>("cloudBuildTargetName");
        }
    public static void PreExport(UnityEngine.CloudBuild.BuildManifestObject manifest)
    {
        var buildNumber = manifest.GetValue <string>("buildNumber");

        UnityEngine.Debug.Log("Setting build number to " + buildNumber);

        if (buildNumber == null || buildNumber.Equals("") || buildNumber.Equals("0"))
        {
            UnityEngine.Debug.LogError("Could not retrieve a build number from the manifest.");
            UnityEngine.Debug.LogError(manifest.ToString());
        }

        UnityEditor.PlayerSettings.Android.bundleVersionCode = int.Parse(buildNumber);
        UnityEditor.PlayerSettings.iOS.buildNumber           = buildNumber;
    }
        public static void TestPostPreExport(UnityEngine.CloudBuild.BuildManifestObject manifest)
        {
            var appwideSOI  = Resources.Load <Game.AppwideSOI>("AppwideSOI");
            var buildNumber = manifest.GetValue("buildNumber", "unknown");

            var filePath = Path.Combine(Application.streamingAssetsPath, "build.txt");

            var buildDesc = string.Format(
                "{0}.{1}.{2}.{3}",
                appwideSOI.settings.major,
                appwideSOI.settings.minor,
                appwideSOI.settings.patch,
                buildNumber);

            using (var outfile = new StreamWriter(filePath))
            {
                outfile.Write(buildDesc);
            }
        }
        // ReSharper disable once RedundantNameQualifier
        public static void PreCloudBuildExport(UnityEngine.CloudBuild.BuildManifestObject manifest)
        {
#if UNITY_CLOUD_BUILD
            Debug.Log("Cloud Build manifest:\r\n" + manifest.ToJson());
#endif

            BuildMetaInfo buildMetaInfo = GetBuildMetaInfo();
            buildMetaInfo.GitBranchName         = manifest.GetValue <string>("scmBranch");
            buildMetaInfo.GitCommitHash         = manifest.GetValue <string>("scmCommitId");
            buildMetaInfo.CloudBuildBuildNumber = Convert.ToInt32(manifest.GetValue <string>("buildNumber"));
            buildMetaInfo.CloudBuildTargetName  = manifest.GetValue <string>("cloudBuildTargetName");

            const int gitShortHashLength = 8;
            buildMetaInfo.GitCommitHash = buildMetaInfo.GitCommitHash.Substring(0,
                                                                                buildMetaInfo.GitCommitHash.Length > gitShortHashLength ?
                                                                                gitShortHashLength :
                                                                                buildMetaInfo.GitCommitHash.Length);

            EditorUtility.SetDirty(buildMetaInfo);
        }
Ejemplo n.º 8
0
 public static void BuildCurrentBundles(UnityEngine.CloudBuild.BuildManifestObject manifest)
 {
     PlayerSettings.bundleVersion += " {0} Build #{1}".With(
         manifest.GetValue <string>("cloudBuildTargetName"),
         manifest.GetValue <string>("buildNumber"));
Ejemplo n.º 9
0
 /// <summary>
 /// Pre-export method for Unity Cloud Build.
 /// </summary>
 static void PreExport(UnityEngine.CloudBuild.BuildManifestObject manifest)
 {
     Util.executeArguments[Util.OPT_DEV_BUILD_NUM] = manifest.GetValue("buildNumber", "unknown");
     Util.GetBuilderFromExecuteArgument().ApplySettings();
 }
Ejemplo n.º 10
0
 public static void PreExport(UnityEngine.CloudBuild.BuildManifestObject manifest)
 {
Ejemplo n.º 11
0
 public static void PreExport(UnityEngine.CloudBuild.BuildManifestObject manifest)
 {
     PlayerSettings.bundleVersion = manifest.GetValue <string>("buildNumber");
     ParallaxHelper.Reindex();
 }