forked from nuke-build/nuke
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBuild.CI.TeamCity.cs
53 lines (51 loc) · 1.79 KB
/
Build.CI.TeamCity.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// Copyright 2023 Maintainers of NUKE.
// Distributed under the MIT License.
// https://github.com/nuke-build/nuke/blob/master/LICENSE
using System;
using System.Collections.Generic;
using System.Linq;
using Nuke.Common.CI.TeamCity.Configuration;
using Nuke.Common.Execution;
using Nuke.Common.Utilities.Collections;
using Nuke.Components;
[TeamCity(
VcsTriggeredTargets =
new[]
{
nameof(IPack.Pack),
nameof(ITest.Test),
nameof(IReportDuplicates.ReportDuplicates),
nameof(IReportIssues.ReportIssues),
nameof(IReportCoverage.ReportCoverage)
},
NonEntryTargets =
new[]
{
nameof(IRestore.Restore),
nameof(DownloadLicenses),
nameof(ICompile.Compile),
nameof(InstallFonts),
nameof(ReleaseImage)
},
ExcludedTargets = new[] { nameof(Clean), nameof(ISignPackages.SignPackages) })]
partial class Build
{
public class TeamCityAttribute : Nuke.Common.CI.TeamCity.TeamCityAttribute
{
protected override IEnumerable<TeamCityBuildType> GetBuildTypes(
ExecutableTarget executableTarget,
TeamCityVcsRoot vcsRoot,
LookupTable<ExecutableTarget, TeamCityBuildType> buildTypes,
IReadOnlyCollection<ExecutableTarget> relevantTargets)
{
return base.GetBuildTypes(executableTarget, vcsRoot, buildTypes, relevantTargets)
.ForEachLazy(x =>
{
var symbol = CustomNames.GetValueOrDefault(x.InvokedTargets.Last());
x.Name = (x.Partition == null
? $"{symbol} {x.Name}"
: $"{symbol} {x.InvokedTargets.Last()} 🧩 {x.Partition}").Trim();
});
}
}
}