Skip to content

Commit a5741d5

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 that tools.ps1 corrupts
1 parent a61cf32 commit a5741d5

File tree

2 files changed

+28
-4
lines changed

2 files changed

+28
-4
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: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,26 @@
11
param(
22
[switch]$ci
33
)
4-
$ErrorActionPreference = 'stop'
54

5+
$ErrorActionPreference = 'stop'
66
$repoRoot = Resolve-Path "$PSScriptRoot/../.."
77

8-
& "$repoRoot\eng\common\msbuild.ps1" -ci:$ci "$repoRoot/eng/CodeGen.proj" `
8+
try {
9+
# eng/common/msbuild.ps1 builds the Debug configuration unless there's a $Configuration variable. Match that here.
10+
& "$repoRoot\build.ps1" -ci:$ci -nobl -buildNative -configuration Debug
11+
12+
Remove-Item variable:global:_BuildTool -ErrorAction Ignore
13+
Remove-Item variable:global:_DotNetInstallDir -ErrorAction Ignore
14+
Remove-Item variable:global:_ToolsetBuildProj -ErrorAction Ignore
15+
Remove-Item variable:global:_MSBuildExe -ErrorAction Ignore
16+
17+
$msbuildEngine = 'dotnet'
18+
& "$repoRoot\eng\common\msbuild.ps1" -ci:$ci "$repoRoot/eng/CodeGen.proj" `
919
/t:GenerateReferenceSources `
1020
/bl:artifacts/log/genrefassemblies.binlog
21+
} finally {
22+
Remove-Item variable:global:_BuildTool -ErrorAction Ignore
23+
Remove-Item variable:global:_DotNetInstallDir -ErrorAction Ignore
24+
Remove-Item variable:global:_ToolsetBuildProj -ErrorAction Ignore
25+
Remove-Item variable:global:_MSBuildExe -ErrorAction Ignore
26+
}

0 commit comments

Comments
 (0)