Exemplo n.º 1
0
        public static void PerformAutoBuild()
        {
            var buildName = CommandLineArgs.GetArgumentValue("buildName");

            Debug.Log("PerformAutoBuild running for build name \"" + buildName + "\"");

            BuildManagerWindow bmw = ScriptableObject.CreateInstance("BuildManagerWindow") as BuildManagerWindow;

            Debug.Log("Loading manifest at " + bmw.ManifestPath);
            bmw.LoadManifest();

            BuildEntry buildEntry = bmw.Manifest.Builds.Find(e => e.Name == buildName);

            if (buildEntry == null)
            {
                Debug.Log("Failure:  Haxxis build entry not found.");
                EditorApplication.Exit(1);
                return;
            }

            //buildEntry.DoCopyFolders = true;
            buildEntry.DoCopyLocalFolders = true;
            buildEntry.DoCopyLocalFiles   = true;
            buildEntry.DoDeploy           = false;

            Debug.Log("Starting the build");
            BuildPathEnvironmentVariable candidateBuildRootEnvVar = new BuildPathEnvironmentVariable(
                @"CGC_CANDIDATE_BUILD_ROOT",
                "Value should be the path where candidate builds should be placed (only used by Build Server).");
            var success = buildEntry.Build(candidateBuildRootEnvVar);

            if (!success)
            {
                Debug.Log("PerformAutoBuild failed");
                EditorApplication.Exit(1);
                return;
            }

            Debug.Log("Finished running PerformAutoBuild");
        }
Exemplo n.º 2
0
        public static void PerformAutoDeploy()
        {
            // This is a call designed to be made externally, to do just the 'deploy' step on an already-built local build.
            var buildName = CommandLineArgs.GetArgumentValue("buildName");

            Debug.Log("PerformAutoDeploy running for build name \"" + buildName + "\"");

            BuildManagerWindow bmw = ScriptableObject.CreateInstance("BuildManagerWindow") as BuildManagerWindow;

            Debug.Log("Loading manifest at " + bmw.ManifestPath);
            bmw.LoadManifest();

            BuildEntry buildEntry = bmw.Manifest.Builds.Find(e => e.Name == buildName);

            if (buildEntry == null)
            {
                Debug.Log("Failure:  Haxxis build entry not found.");
                EditorApplication.Exit(1);
                return;
            }

            buildEntry.DoDeploy = true;
            BuildPathEnvironmentVariable candidateBuildRootEnvVar = new BuildPathEnvironmentVariable(
                @"CGC_CANDIDATE_BUILD_ROOT",
                "Value should be the path where candidate builds should be placed (only used by Build Server).");
            var    path             = Path.Combine(candidateBuildRootEnvVar.Value, buildEntry.Name);
            var    filename         = Path.Combine(path, BuildEntry.LastBuildMadeFilename);
            string lastBuildDirName = File.ReadAllText(filename);

            Debug.Log("Starting the deploy");
            var relativePath = Path.Combine(buildEntry.Name, lastBuildDirName);

            buildEntry.Deploy(relativePath, candidateBuildRootEnvVar);

            Debug.Log("Finished running PerformAutoDeploy");
        }