Skip to content

Commit 5ad1bd0

Browse files
committed
Adjust generation scripts to explicitly choose the MSBuild engine
- ensure native assets are included in GenerateReferenceAssemblies.ps1 build - clean up the global state tools.ps1 corrupts
1 parent a0fb504 commit 5ad1bd0

File tree

2 files changed

+24
-5
lines changed

2 files changed

+24
-5
lines changed

eng/scripts/GenerateProjectList.ps1

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
param(
22
[switch]$ci
33
)
4-
$ErrorActionPreference = 'stop'
54

5+
$ErrorActionPreference = 'stop'
6+
$msbuildEngine = 'dotnet'
67
$repoRoot = Resolve-Path "$PSScriptRoot/../.."
78

8-
& "$repoRoot\eng\common\msbuild.ps1" -ci:$ci "$repoRoot/eng/CodeGen.proj" `
9+
try {
10+
& "$repoRoot\eng\common\msbuild.ps1" -ci:$ci "$repoRoot/eng/CodeGen.proj" `
911
/t:GenerateProjectList `
1012
/bl:artifacts/log/genprojlist.binlog
13+
} finally {
14+
Remove-Item variable:global:_BuildTool -ErrorAction Ignore
15+
Remove-Item variable:global:_DotNetInstallDir -ErrorAction Ignore
16+
Remove-Item variable:global:_ToolsetBuildProj -ErrorAction Ignore
17+
Remove-Item variable:global:_MSBuildExe -ErrorAction Ignore
18+
}
Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
11
param(
22
[switch]$ci
33
)
4-
$ErrorActionPreference = 'stop'
54

5+
# GenAPI with `dotnet msbuild` doesn't consistently order attributes in Microsoft.AspNetCore.Mvc.TagHelpers.netcoreapp.cs
6+
$msbuildEngine = 'vs'
7+
8+
$ErrorActionPreference = 'stop'
69
$repoRoot = Resolve-Path "$PSScriptRoot/../.."
710

8-
& "$repoRoot\eng\common\msbuild.ps1" -ci:$ci "$repoRoot/eng/CodeGen.proj" `
11+
try {
12+
& "$repoRoot\eng\common\msbuild.ps1" -ci:$ci "$repoRoot/eng/CodeGen.proj" `
913
/t:GenerateReferenceSources `
10-
/bl:artifacts/log/genrefassemblies.binlog
14+
/bl:artifacts/log/genrefassemblies.binlog `
15+
/p:BuildNative=true
16+
} finally {
17+
Remove-Item variable:global:_BuildTool -ErrorAction Ignore
18+
Remove-Item variable:global:_DotNetInstallDir -ErrorAction Ignore
19+
Remove-Item variable:global:_ToolsetBuildProj -ErrorAction Ignore
20+
Remove-Item variable:global:_MSBuildExe -ErrorAction Ignore
21+
}

0 commit comments

Comments
 (0)