Пример #1
0
        private static AndroidBuildResult GetAndroidBuildResult(BuildReport buildReport)
        {
            var androidBuildResult = new AndroidBuildResult();

            androidBuildResult.Report = buildReport;
            switch (buildReport.summary.result)
            {
            case BuildResult.Succeeded:
                // Do nothing.
                break;

            case BuildResult.Cancelled:
                androidBuildResult.Cancelled = true;
                break;

            case BuildResult.Failed:
                androidBuildResult.ErrorMessage =
                    string.Format("Build failed with {0} error(s)", buildReport.summary.totalErrors);
                break;

            case BuildResult.Unknown:
                androidBuildResult.ErrorMessage = "Build failed with unknown result";
                break;

            default:
                androidBuildResult.ErrorMessage =
                    "Build failed with unexpected result: " + buildReport.summary.result;
                break;
            }

            return(androidBuildResult);
        }
Пример #2
0
        private static AndroidBuildResult GetAndroidBuildResult(string errorMessage)
        {
            var androidBuildResult = new AndroidBuildResult();

            if (errorMessage == BuildCancelledMessage)
            {
                androidBuildResult.Cancelled = true;
            }
            else if (!string.IsNullOrEmpty(errorMessage))
            {
                // Assume that a null or empty error message string indicates success.
                androidBuildResult.ErrorMessage = errorMessage;
            }

            return(androidBuildResult);
        }