internal static string GetArtifactPath(BuildConfiguration config) => GetArtifactsPath(GetBuildConfigurationName(config));
Esempio n. 2
0
 /// <summary>
 /// Get a build result representing a success.
 /// </summary>
 /// <param name="pipeline">The build pipeline.</param>
 /// <param name="config">The build configuration.</param>
 /// <returns>A new build result instance.</returns>
 public static BuildResult Success(BuildPipelineBase pipeline, BuildConfiguration config) => new BuildResult
 {
     Succeeded          = true,
     BuildPipeline      = pipeline,
     BuildConfiguration = config
 };
 /// <summary>
 /// Get the value of the first build artifact that is assignable to type <typeparamref name="T"/>.
 /// </summary>
 /// <typeparam name="T">The type of the build artifact.</typeparam>
 /// <param name="config">The build configuration that was used to store the build artifact.</param>
 /// <returns>The build artifact if found, <see langword="null"/> otherwise.</returns>
 public static T GetBuildArtifact <T>(BuildConfiguration config) where T : class, IBuildArtifact => (T)GetBuildArtifact(config, typeof(T));
 /// <summary>
 /// Get the last build result from building the build configuration specified.
 /// </summary>
 /// <param name="config">The build configuration that was used to store the build artifact.</param>
 /// <returns>The build result if found, <see langword="null"/> otherwise.</returns>
 public static BuildPipelineResult GetBuildResult(BuildConfiguration config) => GetArtifactData(config)?.Result;
Esempio n. 5
0
 /// <summary>
 /// Get the build result of the last <see cref="BuildConfiguration.Build"/> performed.
 /// </summary>
 /// <returns>The build result if found, <see langword="null"/> otherwise.</returns>
 public BuildResult GetBuildResult() => BuildConfiguration.GetBuildResult();
Esempio n. 6
0
 internal CleanContext(BuildPipelineBase pipeline, BuildConfiguration config)
     : base(pipeline, config)
 {
 }
 public static BuildResult GetBuildResult(BuildConfiguration config)
 {
     return(GetBuildArtifactData(config)?.Result);
 }
Esempio n. 8
0
 /// <summary>
 /// Directory containing final build files.
 /// </summary>
 /// <param name="config">The build configuration containing the information .</param>
 /// <returns>Returns the directory path.</returns>
 public abstract DirectoryInfo GetOutputBuildDirectory(BuildConfiguration config);
 public static T GetBuildArtifact <T>(BuildConfiguration config) where T : class, IBuildArtifact, new()
 {
     return((T)GetAllBuildArtifacts(config)?.FirstOrDefault(a => typeof(T).IsAssignableFrom(a.GetType())));
 }
 public static IEnumerable <IBuildArtifact> GetAllBuildArtifacts(BuildConfiguration config)
 {
     return(GetBuildArtifactData(config)?.Artifacts ?? Enumerable.Empty <IBuildArtifact>());
 }
 public static IBuildArtifact GetBuildArtifact(BuildConfiguration config, Type buildArtifactType)
 {
     ValidateBuildArtifactTypeAndThrow(buildArtifactType);
     return(GetAllBuildArtifacts(config)?.FirstOrDefault(a => buildArtifactType.IsAssignableFrom(a.GetType())));
 }
 public static bool HasBuildArtifact <T>(BuildConfiguration config) where T : class, IBuildArtifact, new()
 {
     return(GetAllBuildArtifacts(config).Any(a => typeof(T).IsAssignableFrom(a.GetType())));
 }
 public static bool HasBuildArtifact(BuildConfiguration config, Type buildArtifactType)
 {
     ValidateBuildArtifactTypeAndThrow(buildArtifactType);
     return(GetAllBuildArtifacts(config).Any(a => buildArtifactType.IsAssignableFrom(a.GetType())));
 }
Esempio n. 14
0
 /// <summary>
 /// Determine if component is used by the build pipeline.
 /// Returns <see langword="false"/> if this build configuration does not have a build pipeline.
 /// </summary>
 /// <param name="type">The component type.</param>
 /// <returns><see langword="true"/> if the component is used by the build pipeline, <see langword="false"/> otherwise.</returns>
 public bool IsComponentUsed(Type type)
 {
     BuildConfiguration.ValidateComponentTypeAndThrow(type);
     return(UsedComponents.Any(usedComponent => usedComponent.IsAssignableFrom(type)));
 }
Esempio n. 15
0
 internal RunContext(BuildPipelineBase pipeline, BuildConfiguration config, params RunTargetBase[] runTargets)
     : base(pipeline, config)
 {
     RunTargets = runTargets ?? Array.Empty <RunTargetBase>();
 }