Ejemplo n.º 1
0
        public void Execute()
        {
            CLITools.PrintBanner("Build");

            // TODO: Find a way to extract this into a build-script plugin.
            ScenesMenu.GenerateMapData();
            string staticDataPath = Path.Combine(buildPath, ScenesMenu.MAP_PATH);

            new FileInfo(staticDataPath).Directory?.Create();
            File.Copy(Path.Combine(Application.persistentDataPath, ScenesMenu.MAP_PATH), staticDataPath, true);


            if (target == BuildTarget.Android)
            {
                HandleAndroidAppBundle();
                HandleAndroidBundleVersionCode();
                HandleAndroidKeystore();
            }

            SetScriptingBackendFromEnv(target);

            string[]    scenes = CLITools.GetEnabledScenes();
            BuildReport report = BuildPipeline.BuildPlayer(scenes, fixedBuildPath, target, buildOpts);

            if (report.summary.result != UnityEditor.Build.Reporting.BuildResult.Succeeded)
            {
                throw new Exception($"Build ended with {report.summary.result} status");
            }
            else
            {
                PrintReport(report);
            }
        }
Ejemplo n.º 2
0
        public void RunFinished(ITestResultAdaptor results)
        {
            if (silent && results.FailCount == 0)
            {
                return;
            }

            if (verbose || results.FailCount > 0)
            {
                CLITools.PrintBanner("Tests");
                PrintTest(results, 0);
            }

            Console.WriteLine();
            CLITools.PrintInlineBanner("Test Summary");
            Console.WriteLine(" Passed: " + results.PassCount);
            Console.WriteLine(" Failed: " + results.FailCount);
            Console.WriteLine(" Skipped/Inconclusive: " + (results.SkipCount + results.InconclusiveCount));
            CLITools.PrintBannerBar();
            Console.WriteLine();

            if (results.FailCount > 0)
            {
                throw new Exception("Fix your tests, dag nabbit!");
            }
        }