@@ -77,14 +77,27 @@ write-host "VCToolsInstallDir: $VCToolsInstallDir"
77
77
$msBuildPath = " $VCToolsInstallDir \MSBuild\Current\Bin\msbuild.exe"
78
78
write-host " msBuildPath: $msBuildPath "
79
79
80
-
81
80
# Generate overrides
82
81
# Make sure override directory exists.
83
82
if (-not (test-path " $buildOverridePath " ))
84
83
{
85
84
new-item - path " $buildOverridePath " - itemtype " directory"
86
85
}
87
86
87
+ function NugetRestore ([string ] $Label , [string ] $Target )
88
+ {
89
+ if ($AzureBuildStep -ne " all" )
90
+ {
91
+ $env: NUGET_RESTORE_MSBUILD_ARGS = " /binaryLogger:BuildOutput\binlogs\$Label .restore.$Platform .$Configuration .binlog /p:Platform=$Platform /p:Configuration=$Configuration "
92
+ }
93
+ & .\.nuget\nuget.exe restore $Target - configfile NuGet.config
94
+ if ($lastexitcode -ne 0 )
95
+ {
96
+ write-host " ERROR: nuget.exe restore $Label FAILED."
97
+ exit 1
98
+ }
99
+ }
100
+
88
101
Try {
89
102
$WindowsAppSDKBuildPipeline = 0
90
103
$WindowsAppSDKVersionProperty = " "
@@ -110,34 +123,23 @@ Try {
110
123
# If $AzureBuildStep is not "all", that means we are in the pipeline
111
124
$WindowsAppSDKBuildPipeline = 1
112
125
}
113
- # PreFastSetup is specifically for use when preparing for PREFast scans. It triggers the same actions below as BuildBinaries or BuildMRT, except
126
+ # PreFastSetup is specifically for use when preparing for PREFast scans. It triggers the same actions below as BuildFoundation or BuildMRT, except
114
127
# PreFastSetup stops short of calling msBuild.exe to build the target, which the Guardian:PREFast task does _not_ support, so the caller of this
115
128
# script needs to resort to calling the MSBuild/VSBuild task later to build the target, which the Guardian:PREFast task does support. Structuring
116
129
# the code this way allows minimally diveraging the flow while supporting building the target both via this script and the VSBuild/MSBuild task.
117
- if (($AzureBuildStep -eq " all" ) -Or (($AzureBuildStep -eq " BuildBinaries " ) -Or ($AzureBuildStep -eq " BuildMRT" ) -Or ($AzureBuildStep -eq " PreFastSetup" )))
130
+ if (($AzureBuildStep -eq " all" ) -Or (($AzureBuildStep -eq " BuildFoundation " ) -Or ($AzureBuildStep -eq " BuildMRT" ) -Or ($AzureBuildStep -eq " PreFastSetup" )))
118
131
{
119
- & .\.nuget\nuget.exe restore WindowsAppRuntime.sln - configfile NuGet.config
120
-
121
- if ($lastexitcode -ne 0 )
122
- {
123
- write-host " ERROR: restore WindowsAppRuntime.sln FAILED."
124
- exit 1
125
- }
126
-
127
- & .\.nuget\nuget.exe restore " dev\Bootstrap\CS\Microsoft.WindowsAppRuntime.Bootstrap.Net\Microsoft.WindowsAppRuntime.Bootstrap.Net.csproj" - configfile NuGet.config
128
-
129
- if ($lastexitcode -ne 0 )
130
- {
131
- write-host " ERROR: restore Microsoft.WindowsAppRuntime.Bootstrap.Net.csproj FAILED."
132
- exit 1
133
- }
132
+ NugetRestore " WindowsAppRuntime" " WindowsAppRuntime.sln"
133
+ NugetRestore " Microsoft.WindowsAppRuntime.Bootstrap.Net" " dev\Bootstrap\CS\Microsoft.WindowsAppRuntime.Bootstrap.Net\Microsoft.WindowsAppRuntime.Bootstrap.Net.csproj"
134
134
135
135
$srcPath = Get-Childitem - Path ' dev\WindowsAppRuntime_Insights\packages' - File ' MicrosoftTelemetry.h' - Recurse
136
136
137
- if (($srcPath -ne $null )){
137
+ if (($srcPath -ne $null ))
138
+ {
138
139
$destinationPaths = Get-Childitem - Path ' packages' - File ' Traceloggingconfig.h' - Recurse
139
140
140
- if (($destinationPaths -ne $null )) {
141
+ if (($destinationPaths -ne $null ))
142
+ {
141
143
foreach ($destPath in $destinationPaths ) {
142
144
Write-Host ' SourcePath:' $srcPath.FullName
143
145
Write-Host ' DestinationPath:' $destPath.FullName
@@ -153,7 +155,7 @@ Try {
153
155
}
154
156
}
155
157
# PreFastSetup intentionally skips the call to MSBuild.exe below.
156
- if (($AzureBuildStep -eq " all" ) -Or ($AzureBuildStep -eq " BuildBinaries " ))
158
+ if (($AzureBuildStep -eq " all" ) -Or ($AzureBuildStep -eq " BuildFoundation " ))
157
159
{
158
160
foreach ($configurationToRun in $configuration.Split (" ," ))
159
161
{
@@ -163,15 +165,15 @@ Try {
163
165
& $msBuildPath / restore `
164
166
WindowsAppRuntime.sln `
165
167
/ p:Configuration= $configurationToRun , Platform= $platformToRun `
166
- / binaryLogger:" BuildOutput/WindowsAppRuntime.$platformToRun .$configurationToRun .binlog" `
168
+ / binaryLogger:" BuildOutput/binlogs/ WindowsAppRuntime.$platformToRun .$configurationToRun .binlog" `
167
169
$WindowsAppSDKVersionProperty `
168
170
/ p:PGOBuildMode= $PGOBuildMode `
169
171
/ p:WindowsAppSDKCleanIntermediateFiles= true `
170
172
/ p:AppxSymbolPackageEnabled= false `
171
173
/ p:WindowsAppSDKBuildPipeline= $WindowsAppSDKBuildPipeline
172
174
if ($lastexitcode -ne 0 )
173
175
{
174
- write-host " ERROR: msbuild.exe /restore WindowsAppRuntime.sln FAILED."
176
+ write-host " ERROR: msbuild.exe WindowsAppRuntime.sln FAILED."
175
177
exit 1
176
178
}
177
179
}
@@ -184,45 +186,11 @@ Try {
184
186
# ------------------
185
187
186
188
# Restore packages from mrt.
187
- & .\.nuget\nuget.exe restore " $MRTSourcesDirectory \mrt\MrtCore.sln" - ConfigFile NuGet.config
188
-
189
- if ($lastexitcode -ne 0 )
190
- {
191
- write-host " ERROR: restore MrtCore.sln FAILED."
192
- exit 1
193
- }
194
-
195
- & .\.nuget\nuget.exe restore " $MRTSourcesDirectory \mrt\Microsoft.Windows.ApplicationModel.Resources\src\packages.config" - ConfigFile NuGet.config
196
-
197
- if ($lastexitcode -ne 0 )
198
- {
199
- write-host " ERROR: restore Microsoft.Windows.ApplicationModel.Resources\src\packages.config FAILED."
200
- exit 1
201
- }
202
-
203
- & .\.nuget\nuget.exe restore " $MRTSourcesDirectory \mrt\mrm\mrmex\packages.config" - ConfigFile NuGet.config
204
-
205
- if ($lastexitcode -ne 0 )
206
- {
207
- write-host " ERROR: restore mrm\mrmex\packages.config FAILED."
208
- exit 1
209
- }
210
-
211
- & .\.nuget\nuget.exe restore " $MRTSourcesDirectory \mrt\mrm\mrmmin\packages.config" - ConfigFile NuGet.config
212
-
213
- if ($lastexitcode -ne 0 )
214
- {
215
- write-host " ERROR: restore mrmmin\packages.config FAILED."
216
- exit 1
217
- }
218
-
219
- & .\.nuget\nuget.exe restore " $MRTSourcesDirectory \mrt\mrm\unittests\packages.config" - ConfigFile NuGet.config
220
-
221
- if ($lastexitcode -ne 0 )
222
- {
223
- write-host " ERROR: restore unittests\packages.config FAILED."
224
- exit 1
225
- }
189
+ NugetRestore " MrtCore" " $MRTSourcesDirectory \mrt\MrtCore.sln"
190
+ NugetRestore " Microsoft.Windows.ApplicationModel.Resources" " $MRTSourcesDirectory \mrt\Microsoft.Windows.ApplicationModel.Resources\src\packages.config"
191
+ NugetRestore " mrmex" " $MRTSourcesDirectory \mrt\mrm\mrmex\packages.config"
192
+ NugetRestore " mrmmin" " $MRTSourcesDirectory \mrt\mrm\mrmmin\packages.config"
193
+ NugetRestore " unittests" " $MRTSourcesDirectory \mrt\mrm\unittests\packages.config"
226
194
227
195
# Init mrtcore
228
196
foreach ($platformToRun in $platform.Split (" ," ))
@@ -247,11 +215,11 @@ Try {
247
215
& $msBuildPath / restore " $MRTSourcesDirectory \mrt\MrtCore.sln" `
248
216
/ p:Configuration= $configurationToRun , Platform= $platformToRun `
249
217
/ p:PGOBuildMode= $PGOBuildMode `
250
- / binaryLogger:" BuildOutput/mrtcore .$platformToRun .$configurationToRun .binlog"
218
+ / binaryLogger:" BuildOutput/binlogs/MrtCore .$platformToRun .$configurationToRun .binlog"
251
219
252
220
if ($lastexitcode -ne 0 )
253
221
{
254
- write-host " ERROR: Building '$MRTSourcesDirectory \mrt\MrtCore.sln' FAILED."
222
+ write-host " ERROR: msbuild.exe '$MRTSourcesDirectory \mrt\MrtCore.sln' FAILED."
255
223
exit 1
256
224
}
257
225
}
@@ -263,11 +231,11 @@ Try {
263
231
# ------------------
264
232
# Build windowsAppRuntime.sln (anyCPU) and move output to staging.
265
233
# ------------------
266
- # build AnyCPU
234
+ # build and restore AnyCPU
267
235
& $msBuildPath / restore " dev\Bootstrap\CS\Microsoft.WindowsAppRuntime.Bootstrap.Net\Microsoft.WindowsAppRuntime.Bootstrap.Net.csproj" / p:Configuration= $configurationForMrtAndAnyCPU , Platform= AnyCPU
268
236
if ($lastexitcode -ne 0 )
269
237
{
270
- write-host " ERROR: msbuild restore Microsoft.WindowsAppRuntime.Bootstrap.Net.csproj FAILED."
238
+ write-host " ERROR: msbuild.exe Microsoft.WindowsAppRuntime.Bootstrap.Net.csproj FAILED."
271
239
exit 1
272
240
}
273
241
}
@@ -418,12 +386,6 @@ Try {
418
386
exit 1
419
387
}
420
388
}
421
- # if (($AzureBuildStep -eq "all") -Or ($AzureBuildStep -eq "BuildMock"))
422
- # {
423
- # $transportPackagepath = (Join-Path $OutputDirectory "Microsoft.WindowsAppSDK.Foundation.TransportPackage.$PackageVersion.nupkg")
424
- # . eng\common\Scripts\buildMockWinAppSdkPackage.ps1 -TransportPackageName "Foundation" -TransportPackagePath $transportPackagepath -RepoRoot $env:Build_SourcesDirectory -Output $OutputDirectory -Platform $Platform -Configuration $Configuration -TransportPackageVersion $PackageVersion -CleanOutput
425
- # }
426
-
427
389
$files = Get-ChildItem $OutputDirectory - File - Filter " *.nupkg"
428
390
foreach ($file in $files )
429
391
{
0 commit comments