/// <summary> /// Get a run result representing a failure. /// </summary> /// <param name="pipeline">The build pipeline.</param> /// <param name="config">The build configuration.</param> /// <param name="reason">The reason of the failure.</param> /// <returns>A new run result instance.</returns> public static RunResult Failure(BuildPipelineBase pipeline, BuildConfiguration config, string reason) => new RunResult { Succeeded = false, BuildPipeline = pipeline, BuildConfiguration = config, Message = reason };
/// <summary> /// Get a run result representing a failure. /// </summary> /// <param name="pipeline">The build pipeline.</param> /// <param name="config">The build configuration.</param> /// <param name="exception">The exception that was thrown.</param> /// <returns>A new run result instance.</returns> public static RunResult Failure(BuildPipelineBase pipeline, BuildConfiguration config, Exception exception) => new RunResult { Succeeded = false, BuildPipeline = pipeline, BuildConfiguration = config, Exception = exception };
/// <summary> /// Get a run result representing a success. /// </summary> /// <param name="pipeline">The build pipeline.</param> /// <param name="config">The build configuration.</param> /// <param name="instance">The run process instance.</param> /// <returns>A new run result instance.</returns> public static RunResult Success(BuildPipelineBase pipeline, BuildConfiguration config, IRunInstance instance = null) => new RunResult { Succeeded = true, BuildPipeline = pipeline, BuildConfiguration = config, RunInstance = instance };
internal ContextBase(BuildPipelineBase pipeline, BuildConfiguration config) { BuildPipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); BuildConfiguration = config ?? throw new ArgumentNullException(nameof(config)); // Prevent the build configuration asset from being destroyed during a build BuildConfiguration.hideFlags |= HideFlags.DontUnloadUnusedAsset | HideFlags.HideAndDontSave; }
internal static BuildProcess Failure(BuildPipelineBase pipeline, BuildConfiguration config, Exception exception) => new BuildProcess { Result = BuildResult.Failure(pipeline, config, exception) };
internal static BuildProcess Failure(BuildPipelineBase pipeline, BuildConfiguration config, string reason) => new BuildProcess { Result = BuildResult.Failure(pipeline, config, reason) };
internal static BuildProcess Success(BuildPipelineBase pipeline, BuildConfiguration config) => new BuildProcess { Result = BuildResult.Success(pipeline, config) };
internal BuildContext(BuildPipelineBase pipeline, BuildConfiguration config, BuildProgress progress = null) : base(pipeline, config) { BuildProgress = progress; }
/// <summary> /// Get a clean result representing a success. /// </summary> /// <param name="pipeline">The build pipeline.</param> /// <param name="config">The build configuration.</param> /// <returns>A new clean result instance.</returns> public static CleanResult Success(BuildPipelineBase pipeline, BuildConfiguration config) => new CleanResult { Succeeded = true, BuildPipeline = pipeline, BuildConfiguration = config, };
internal RunContext(BuildPipelineBase pipeline, BuildConfiguration config) : base(pipeline, config) { }
internal RunContext(BuildPipelineBase pipeline, BuildConfiguration config, params RunTargetBase[] runTargets) : base(pipeline, config) { RunTargets = runTargets ?? Array.Empty <RunTargetBase>(); }