Skip to content

Commit f63757d

Browse files
committed
(build) cleanup
1 parent 31a8a72 commit f63757d

File tree

6 files changed

+11
-14
lines changed

6 files changed

+11
-14
lines changed

build/artifacts/BuildLifetime.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ public override void Setup(BuildContext context, ISetupContext info)
1515
var dotnetVersion = context.Argument(Arguments.DockerDotnetVersion, string.Empty).ToLower();
1616
var dockerDistro = context.Argument(Arguments.DockerDistro, string.Empty).ToLower();
1717

18-
var versions = string.IsNullOrWhiteSpace(dotnetVersion) ? Constants.VersionsToBuild : new[] { dotnetVersion };
19-
var distros = string.IsNullOrWhiteSpace(dockerDistro) ? Constants.DockerDistrosToBuild : new[] { dockerDistro };
18+
var versions = string.IsNullOrWhiteSpace(dotnetVersion) ? Constants.VersionsToBuild : [dotnetVersion];
19+
var distros = string.IsNullOrWhiteSpace(dockerDistro) ? Constants.DockerDistrosToBuild : [dockerDistro];
2020

2121
var architectures = context.HasArgument(Arguments.Architecture) ? context.Arguments<Architecture>(Arguments.Architecture) : Constants.ArchToBuild;
2222

build/artifacts/Tasks/ArtifactsExecutableTest.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,7 @@ private static void PackageTest(BuildContextBase context, string packageToTest)
4747

4848
var settings = new GitVersionSettings
4949
{
50-
OutputTypes = new HashSet<GitVersionOutput>
51-
{
52-
GitVersionOutput.Json
53-
},
50+
OutputTypes = [GitVersionOutput.Json],
5451
ToolPath = outputDirectory.Combine(packageToTest).Combine("tools").CombineWithFilePath("gitversion.exe").FullPath
5552
};
5653
var gitVersion = context.GitVersion(settings);

build/build/BuildContext.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ public class BuildContext : BuildContextBase
99

1010
public readonly Dictionary<PlatformFamily, string[]> NativeRuntimes = new()
1111
{
12-
[PlatformFamily.Windows] = new[] { "win-x64", "win-arm64" },
13-
[PlatformFamily.Linux] = new[] { "linux-x64", "linux-musl-x64", "linux-arm64", "linux-musl-arm64" },
14-
[PlatformFamily.OSX] = new[] { "osx-x64", "osx-arm64" },
12+
[PlatformFamily.Windows] = ["win-x64", "win-arm64"],
13+
[PlatformFamily.Linux] = ["linux-x64", "linux-musl-x64", "linux-arm64", "linux-musl-arm64"],
14+
[PlatformFamily.OSX] = ["osx-x64", "osx-arm64"],
1515
};
1616

1717
public bool EnabledUnitTests { get; set; }

build/build/Tasks/Test/UnitTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public override void Run(BuildContext context)
2424
{
2525
throw new Exception($"Dotnet Target {dotnetTarget} is not supported at the moment");
2626
}
27-
frameworks = new[] { dotnetTarget };
27+
frameworks = [dotnetTarget];
2828
}
2929

3030
foreach (var framework in frameworks)
@@ -81,7 +81,7 @@ private static void TestProjectForTarget(BuildContext context, FilePath project,
8181
CoverletOutputFormat = CoverletOutputFormat.cobertura,
8282
CoverletOutputDirectory = testResultsPath,
8383
CoverletOutputName = $"{projectName}.coverage.xml",
84-
Exclude = new List<string> { "[GitVersion*.Tests]*", "[GitTools.Testing]*" }
84+
Exclude = ["[GitVersion*.Tests]*", "[GitTools.Testing]*"]
8585
};
8686

8787
context.DotNetTest(project.FullPath, settings, coverletSettings);

build/common/Lifetime/BuildLifetimeBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public override void Setup(T context, ISetupContext info)
3333
var gitVersionSettings = new GitVersionSettings
3434
{
3535
OutputTypes = [GitVersionOutput.Json, GitVersionOutput.BuildServer],
36-
ToolPath = context.Tools.Resolve(new[] { "dotnet.exe", "dotnet" }),
36+
ToolPath = context.Tools.Resolve(["dotnet.exe", "dotnet"]),
3737
ArgumentCustomization = args => args.Prepend(context.GetGitVersionDotnetToolLocation()?.FullPath ?? throw new FileNotFoundException("Failed to locate the Release build of gitversion.dll in ./tools/gitversion. Try running \"./build.ps1 -Stage build -Target BuildPrepare\""))
3838
};
3939

build/docker/BuildLifetime.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ public override void Setup(BuildContext context, ISetupContext info)
1919
var dotnetVersion = context.Argument(Arguments.DockerDotnetVersion, string.Empty).ToLower();
2020
var dockerDistro = context.Argument(Arguments.DockerDistro, string.Empty).ToLower();
2121

22-
var versions = string.IsNullOrWhiteSpace(dotnetVersion) ? Constants.VersionsToBuild : new[] { dotnetVersion };
23-
var distros = string.IsNullOrWhiteSpace(dockerDistro) ? Constants.DockerDistrosToBuild : new[] { dockerDistro };
22+
var versions = string.IsNullOrWhiteSpace(dotnetVersion) ? Constants.VersionsToBuild : [dotnetVersion];
23+
var distros = string.IsNullOrWhiteSpace(dockerDistro) ? Constants.DockerDistrosToBuild : [dockerDistro];
2424

2525
var registry = dockerRegistry == DockerRegistry.DockerHub ? Constants.DockerHubRegistry : Constants.GitHubContainerRegistry;
2626
context.DockerRegistry = dockerRegistry;

0 commit comments

Comments
 (0)