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