public void CreateBuildWithReportMarker() { MobileBuildReportSettingsManager.settings.LabelBuildsEnabled = true; MobileBuildReportSettingsManager.settings.ShowReport = false; PlayerSettings.SetScriptingBackend(BuildPipeline.GetBuildTargetGroup(Target), ScriptingRuntime); PreBuildSetup(); var unityReport = BuildPipeline.BuildPlayer(new string[] { "Assets/MobileReportScene.unity" }, BuildLocation, Target, Options); PostBuildCleanup(); ReportLocation = Path.Combine(ArtifactDirectory, "report.json"); Report = MobileBuildReportHelper.Generate(unityReport.summary.outputPath, ReportLocation); }
private void OnGUI() { EditorGUILayout.Space(); EditorGUILayout.BeginHorizontal(); MobileBuildReportSettingsManager.settings.BuildPath = EditorGUILayout.TextField(new GUIContent("Build location", buildSelectTooltip), MobileBuildReportSettingsManager.settings.BuildPath); if (GUILayout.Button(new GUIContent("Select...", buildSelectTooltip), GUILayout.Width(80), GUILayout.Height(18))) { var newLocation = EditorUtility.OpenFilePanel("Select build", CommonTools.ProjectDirectory, ""); MobileBuildReportSettingsManager.settings.BuildPath = !string.IsNullOrEmpty(newLocation) ? newLocation : MobileBuildReportSettingsManager.settings.BuildPath; } EditorGUILayout.EndHorizontal(); if (GUILayout.Button("Generate report")) { MobileBuildReportHelper.Generate(MobileBuildReportSettingsManager.settings.BuildPath); } EditorGUILayout.Space(); if (!MobileBuildReportSettingsManager.settings.LabelBuildsEnabled) { EditorGUILayout.HelpBox("Build labelling is disabled. Mobile BuildReport tool will not work for builds generated without this option. " + "To enable build labelling, go to Edit > Project Settings > Mobile BuildReport", MessageType.Warning, true); } }