protected override StreamWriter CreateStream() { TextTasks.WriteAllLines( PomFile, ResourceUtility.GetResourceAllLines <TeamCityConfiguration>("pom.xml")); return(base.CreateStream()); }
protected override ConfigurationEntity GetConfiguration(NukeBuild build, IReadOnlyCollection <ExecutableTarget> relevantTargets) { TextTasks.WriteAllLines( PomFile, ResourceUtility.GetResourceAllLines <TeamCityConfiguration>("pom.xml")); return(new TeamCityConfiguration { Version = Version, Project = GetProject(build, relevantTargets) }); }
protected override void Generate(NukeBuild build, IReadOnlyCollection <ExecutableTarget> executableTargets) { var relevantTargets = VcsTriggeredTargets.Concat(ManuallyTriggeredTargets) .SelectMany(x => ExecutionPlanner.GetExecutionPlan(executableTargets, new[] { x })) .Distinct() .Where(x => !ExcludedTargets.Contains(x.Name) && !NonEntryTargets.Contains(x.Name)).ToList(); var configuration = GetConfiguration(build, relevantTargets); ControlFlow.Assert(NukeBuild.RootDirectory != null, "NukeBuild.RootDirectory != null"); TextTasks.WriteAllLines( PomFile, ResourceUtility.GetResourceAllLines <TeamCityConfigurationEntity>("pom.xml")); using var writer = new CustomFileWriter(SettingsFile, indentationFactor: 4); configuration.Write(writer); }
protected override void Generate(NukeBuild build, IReadOnlyCollection <ExecutableTarget> executableTargets) { ControlFlow.Assert(NukeBuild.RootDirectory != null, "NukeBuild.RootDirectory != null"); var teamcityDirectory = NukeBuild.RootDirectory / ".teamcity"; TextTasks.WriteAllLines( teamcityDirectory / "pom.xml", ResourceUtility.GetResourceAllLines <TeamCityConfigurationEntity>("pom.xml")); using (var writer = new CustomFileWriter(teamcityDirectory / "settings.kts", indentationFactor: 4)) { GetHeader().ForEach(writer.WriteLine); var project = GetProject(build, executableTargets); project.Write(writer); project.VcsRoot.Write(writer); project.BuildTypes.ForEach(x => x.Write(writer)); } }