public override BuildStepResult RunBuildStep(BuildContext context) { var arguments = BuildContextInternals.GetBuildSettings(context).name; var profile = GetRequiredComponent <DotsRuntimeBuildProfile>(context); var workingDir = profile.BeeRootDirectory; var outputDir = new DirectoryInfo(this.GetOutputBuildDirectory(context)); var result = BeeTools.Run(arguments, workingDir, context.BuildProgress); outputDir.Combine("Logs").GetFile("BuildLog.txt").WriteAllText(result.Output); workingDir.GetFile("runbuild" + ShellScriptExtension()).UpdateAllText(result.Command); if (result.Failed) { return(Failure(result.Error)); } if (!string.IsNullOrEmpty(profile.ProjectName)) { var outputTargetFile = outputDir.GetFile(profile.ProjectName + profile.Target.ExecutableExtension); context.SetValue(new DotsRuntimeBuildArtifact { OutputTargetFile = outputTargetFile }); } return(Success()); }
public override BuildResult Run(BuildContext context) { var profile = context.GetComponentOrDefault <DotsRuntimeBuildProfile>(); var rootAssembly = context.GetComponentOrDefault <DotsRuntimeRootAssembly>(); var targetName = rootAssembly.MakeBeeTargetName(context.BuildConfigurationName); var workingDir = DotsRuntimeRootAssembly.BeeRootDirectory; var outputDir = new DirectoryInfo(BuildStepGenerateBeeFiles.GetFinalOutputDirectory(context, targetName)); var result = BeeTools.Run(targetName, workingDir, context.BuildProgress); WorldExport.GetOrCreateLogDirectoryFrom(targetName).GetFile("BuildLog.txt").WriteAllText(result.Output); workingDir.GetFile("runbuild" + ShellScriptExtension()).UpdateAllText(result.Command); if (result.Failed) { return(context.Failure(result.Error)); } if (!string.IsNullOrEmpty(rootAssembly.ProjectName)) { var outputTargetFile = outputDir.GetFile(rootAssembly.ProjectName + profile.Target.ExecutableExtension); context.SetBuildArtifact(new DotsRuntimeBuildArtifact { OutputTargetFile = outputTargetFile }); } return(context.Success()); }
public static void RunBeeProjectFiles(BuildProgress progress = null) { bool ownProgress = progress == null; if (ownProgress) { progress = new BuildProgress(k_WindowTitle, "Please wait..."); BuildProgramDataFileWriter.WriteAll(BeeRootDirectory.FullName); } var result = BeeTools.Run("ProjectFiles -f", BeeRootDirectory, progress); if (!result.Succeeded) { UnityEngine.Debug.LogError($"{k_WindowTitle} failed.\n{result.Error}"); if (ownProgress) { progress.Dispose(); } return; } if (ownProgress) { progress.Dispose(); } }
static void GenerateSolution() { using (var progress = new BuildProgress(k_Title, "Please wait...")) { var result = BeeTools.Run("ProjectFiles", new DotsRuntimeBuildProfile().BeeRootDirectory, progress); if (!result.Succeeded) { UnityEngine.Debug.LogError($"{k_Title} failed.\n{result.Error}"); return; } var scriptEditor = ScriptEditorUtility.GetExternalScriptEditor(); var projectPath = new NPath(UnityEngine.Application.dataPath).Parent; var pi = new ProcessStartInfo(); pi.FileName = scriptEditor; pi.Arguments = $"{projectPath.Combine(projectPath.FileName + "-Dots.sln").InQuotes()}"; var proc = new Process(); proc.StartInfo = pi; proc.Start(); } }