Skip to content

Commit 2326e86

Browse files
committed
[Build] Update Nuke to 5.1.1
1 parent 7d6a185 commit 2326e86

11 files changed

+193
-60
lines changed

.github/workflows/continuous.yml

+9-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
runs-on: windows-latest
2525
steps:
2626
- uses: actions/checkout@v1
27-
27+
2828
- name: Setup .NET 2.2
2929
uses: actions/setup-dotnet@v1
3030
with:
@@ -45,10 +45,17 @@ jobs:
4545
with:
4646
dotnet-version: 5.0.*
4747

48+
- name: Cache .nuke/temp, ~/.nuget/packages
49+
uses: actions/cache@v2
50+
with:
51+
path: |
52+
.nuke/temp
53+
~/.nuget/packages
54+
key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj') }}
4855
- name: Run './build.cmd Test Pack'
4956
run: ./build.cmd Test Pack
5057
env:
51-
GitHubToken: ${{ secrets.GITHUB_TOKEN }}
58+
GitHubToken: ${{ secrets.GITHUB_TOKEN }}
5259
- uses: actions/upload-artifact@v1
5360
with:
5461
name: test-results

.github/workflows/continuousCore.yml

+15-22
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,17 @@ jobs:
4545
with:
4646
dotnet-version: 5.0.*
4747

48+
- name: Cache .nuke/temp, ~/.nuget/packages
49+
uses: actions/cache@v2
50+
with:
51+
path: |
52+
.nuke/temp
53+
~/.nuget/packages
54+
key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj') }}
4855
- name: Run './build.cmd TestCoreOnly'
4956
run: ./build.cmd TestCoreOnly
5057
env:
51-
GitHubToken: ${{ secrets.GITHUB_TOKEN }}
58+
GitHubToken: ${{ secrets.GITHUB_TOKEN }}
5259
- uses: actions/upload-artifact@v1
5360
with:
5461
name: test-results
@@ -58,31 +65,17 @@ jobs:
5865
runs-on: macOS-latest
5966
steps:
6067
- uses: actions/checkout@v1
61-
62-
- name: Setup .NET 2.2
63-
uses: actions/setup-dotnet@v1
68+
- name: Cache .nuke/temp, ~/.nuget/packages
69+
uses: actions/cache@v2
6470
with:
65-
dotnet-version: 2.2.*
66-
67-
- name: Setup .NET 3.0
68-
uses: actions/setup-dotnet@v1
69-
with:
70-
dotnet-version: 3.0.*
71-
72-
- name: Setup .NET 3.1
73-
uses: actions/setup-dotnet@v1
74-
with:
75-
dotnet-version: 3.1.*
76-
77-
- name: Setup .NET 5.0
78-
uses: actions/setup-dotnet@v1
79-
with:
80-
dotnet-version: 5.0.*
81-
71+
path: |
72+
.nuke/temp
73+
~/.nuget/packages
74+
key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj') }}
8275
- name: Run './build.cmd TestCoreOnly'
8376
run: ./build.cmd TestCoreOnly
8477
env:
85-
GitHubToken: ${{ secrets.GITHUB_TOKEN }}
78+
GitHubToken: ${{ secrets.GITHUB_TOKEN }}
8679
- uses: actions/upload-artifact@v1
8780
with:
8881
name: test-results

.nuke

-1
This file was deleted.

.nuke/build.schema.json

+119
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-04/schema#",
3+
"title": "Build Schema",
4+
"$ref": "#/definitions/build",
5+
"definitions": {
6+
"build": {
7+
"type": "object",
8+
"properties": {
9+
"Configuration": {
10+
"type": "string",
11+
"description": "Configuration to build - Default is 'Debug' (local) or 'Release' (server)",
12+
"enum": [
13+
"Debug",
14+
"Release"
15+
]
16+
},
17+
"Continue": {
18+
"type": "boolean",
19+
"description": "Indicates to continue a previously failed build attempt"
20+
},
21+
"GitHubToken": {
22+
"type": "string",
23+
"description": "GitHub Token"
24+
},
25+
"Help": {
26+
"type": "boolean",
27+
"description": "Shows the help text for this build assembly"
28+
},
29+
"Host": {
30+
"type": "string",
31+
"description": "Host for execution. Default is 'automatic'",
32+
"enum": [
33+
"AppVeyor",
34+
"AzurePipelines",
35+
"Bamboo",
36+
"Bitrise",
37+
"GitHubActions",
38+
"GitLab",
39+
"Jenkins",
40+
"SpaceAutomation",
41+
"TeamCity",
42+
"Terminal",
43+
"TravisCI"
44+
]
45+
},
46+
"NoLogo": {
47+
"type": "boolean",
48+
"description": "Disables displaying the NUKE logo"
49+
},
50+
"Plan": {
51+
"type": "boolean",
52+
"description": "Shows the execution plan (HTML)"
53+
},
54+
"Profile": {
55+
"type": "array",
56+
"description": "Defines the profiles to load",
57+
"items": {
58+
"type": "string"
59+
}
60+
},
61+
"Root": {
62+
"type": "string",
63+
"description": "Root directory during build execution"
64+
},
65+
"Skip": {
66+
"type": "array",
67+
"description": "List of targets to be skipped. Empty list skips all dependencies",
68+
"items": {
69+
"type": "string",
70+
"enum": [
71+
"Clean",
72+
"Compile",
73+
"CompileCoreOnly",
74+
"Pack",
75+
"PackCoreOnly",
76+
"Restore",
77+
"Test",
78+
"TestCoreOnly"
79+
]
80+
}
81+
},
82+
"Solution": {
83+
"type": "string",
84+
"description": "Path to a solution file that is automatically loaded"
85+
},
86+
"Target": {
87+
"type": "array",
88+
"description": "List of targets to be invoked. Default is '{default_target}'",
89+
"items": {
90+
"type": "string",
91+
"enum": [
92+
"Clean",
93+
"Compile",
94+
"CompileCoreOnly",
95+
"Pack",
96+
"PackCoreOnly",
97+
"Restore",
98+
"Test",
99+
"TestCoreOnly"
100+
]
101+
}
102+
},
103+
"TestPartition": {
104+
"type": "string"
105+
},
106+
"Verbosity": {
107+
"type": "string",
108+
"description": "Logging verbosity during build execution. Default is 'Normal'",
109+
"enum": [
110+
"Minimal",
111+
"Normal",
112+
"Quiet",
113+
"Verbose"
114+
]
115+
}
116+
}
117+
}
118+
}
119+
}

.nuke/parameters.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"$schema": "./build.schema.json",
3+
"Solution": "StructLinq.sln"
4+
}

Build/Nuke/Build.AzurePipelinesAttribute.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ protected override AzurePipelinesJob GetJob(ExecutableTarget executableTarget, L
6161
};
6262
var symbol = dictionary.GetValueOrDefault(job.Name);
6363
var prefix = symbol == null ? "" : $"{symbol} ";
64-
job.DisplayName = job.PartitionName == null
64+
job.DisplayName = job.Parallel == 0
6565
? $"{prefix}{job.DisplayName}"
6666
: $"{prefix}{job.DisplayName} 🧩";
6767
return job;

Build/Nuke/NukeBuild.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net50</TargetFramework>
5+
<TargetFramework>net5.0</TargetFramework>
66
<NoWarn>CS0649;CS0169</NoWarn>
77
<CheckEolTargetFramework>false</CheckEolTargetFramework>
88
<NukeRootDirectory>..\..</NukeRootDirectory>
99
<NukeScriptDirectory>..\..</NukeScriptDirectory>
1010
</PropertyGroup>
1111

1212
<ItemGroup>
13-
<PackageReference Include="Nuke.Common" Version="5.0.2" />
13+
<PackageReference Include="Nuke.Common" Version="5.1.1" />
1414
<PackageDownload Include="GitVersion.Tool" Version="[5.6.8]" />
1515
</ItemGroup>
1616

azure-pipelines.yml

+15
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ stages:
3636
displayName: '⚙️ Compile'
3737
dependsOn: [ Setup ]
3838
steps:
39+
- task: Cache@2
40+
inputs:
41+
key: $(Agent.OS) | **/global.json, **/*.csproj
42+
restoreKeys: $(Agent.OS)
43+
path: ~/.nuget/packages
3944
- task: CmdLine@2
4045
inputs:
4146
script: './build.cmd Restore Compile --skip'
@@ -45,6 +50,11 @@ stages:
4550
strategy:
4651
parallel: 4
4752
steps:
53+
- task: Cache@2
54+
inputs:
55+
key: $(Agent.OS) | **/global.json, **/*.csproj
56+
restoreKeys: $(Agent.OS)
57+
path: ~/.nuget/packages
4858
- task: CmdLine@2
4959
inputs:
5060
script: './build.cmd Test --skip --test-partition $(System.JobPositionInPhase)'
@@ -56,6 +66,11 @@ stages:
5666
displayName: '📦 Pack'
5767
dependsOn: [ Compile ]
5868
steps:
69+
- task: Cache@2
70+
inputs:
71+
key: $(Agent.OS) | **/global.json, **/*.csproj
72+
restoreKeys: $(Agent.OS)
73+
path: ~/.nuget/packages
5974
- task: CmdLine@2
6075
inputs:
6176
script: './build.cmd Pack --skip'

build.cmd

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
:; set -eo pipefail
2-
:; ./build.sh "$@"
2+
:; SCRIPT_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)
3+
:; ${SCRIPT_DIR}/build.sh "$@"
34
:; exit $?
45

56
@ECHO OFF
6-
powershell -ExecutionPolicy ByPass -NoProfile %0\..\build.ps1 %*
7+
powershell -ExecutionPolicy ByPass -NoProfile -File "%~dp0build.ps1" %*

build.ps1

+8-13
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,16 @@ $PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent
1313
# CONFIGURATION
1414
###########################################################################
1515

16-
1716
$BuildProjectFile = "$PSScriptRoot\Build\Nuke\NukeBuild.csproj"
17+
$TempDirectory = "$PSScriptRoot\\.nuke\temp"
1818

19-
$TempDirectory = "$PSScriptRoot\.tmp"
20-
21-
$DotNetGlobalFile = "$PSScriptRoot\global.json"
19+
$DotNetGlobalFile = "$PSScriptRoot\\global.json"
2220
$DotNetInstallUrl = "https://dot.net/v1/dotnet-install.ps1"
2321
$DotNetChannel = "Current"
2422

2523
$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = 1
2624
$env:DOTNET_CLI_TELEMETRY_OPTOUT = 1
2725
$env:DOTNET_MULTILEVEL_LOOKUP = 0
28-
$env:DOTNET_ROLL_FORWARD = "Major"
2926

3027
###########################################################################
3128
# EXECUTION
@@ -40,11 +37,11 @@ function ExecSafe([scriptblock] $cmd) {
4037
Get-Item -Path Env:* | Sort-Object -Property Name | ForEach-Object {"{0}={1}" -f $_.Name,$_.Value}
4138

4239
# If dotnet CLI is installed globally and it matches requested version, use for execution
43-
if ($null -ne (Get-Command "dotnet" -ErrorAction SilentlyContinue) -and `
40+
if ($null -ne (Get-Command "dotnet" -ErrorAction SilentlyContinue) -and `
4441
$(dotnet --version) -and $LASTEXITCODE -eq 0) {
45-
$env:DOTNET_EXE = (Get-Command "dotnet").Path
46-
}
47-
else {
42+
$env:DOTNET_EXE = (Get-Command "dotnet").Path
43+
}
44+
else {
4845
# Download install script
4946
$DotNetInstallFile = "$TempDirectory\dotnet-install.ps1"
5047
New-Item -ItemType Directory -Path $TempDirectory -Force | Out-Null
@@ -67,11 +64,9 @@ Get-Item -Path Env:* | Sort-Object -Property Name | ForEach-Object {"{0}={1}" -f
6764
ExecSafe { & $DotNetInstallFile -InstallDir $DotNetDirectory -Version $DotNetVersion -NoPath }
6865
}
6966
$env:DOTNET_EXE = "$DotNetDirectory\dotnet.exe"
70-
}
71-
72-
Write-Output "Path: $($env:DOTNET_EXE)"
67+
}
7368

7469
Write-Output "Microsoft (R) .NET Core SDK version $(& $env:DOTNET_EXE --version)"
7570

76-
ExecSafe { & $env:DOTNET_EXE build $BuildProjectFile /nodeReuse:false /p:UseSharedCompilation=false -nologo -clp:NoSummary }
71+
ExecSafe { & $env:DOTNET_EXE build $BuildProjectFile /nodeReuse:false /p:UseSharedCompilation=false -nologo -clp:NoSummary --verbosity quiet }
7772
ExecSafe { & $env:DOTNET_EXE run --project $BuildProjectFile --no-build -- $BuildArguments }

0 commit comments

Comments
 (0)