@@ -32,23 +32,24 @@ $buildOverridePath = "build\override"
32
32
$BasePath = " BuildOutput/FullNuget"
33
33
34
34
# FUTURE(YML2PS): Update build to no longer place generated files in sources directory
35
- if ($Clean )
35
+ if ($Clean )
36
36
{
37
37
$CleanTargets = @ (
38
38
" BuildOutput" ,
39
39
" obj" ,
40
+ " .user" ,
40
41
$buildOverridePath
41
42
)
42
-
43
+
43
44
foreach ($CleanTarget in $CleanTargets )
44
45
{
45
46
$CleanTargetPath = (Join-Path $env: Build_SourcesDirectory $CleanTarget )
46
-
47
+
47
48
if (Test-Path ($CleanTargetPath )) {
48
49
Remove-Item $CleanTargetPath - recurse
49
50
}
50
51
}
51
-
52
+
52
53
Exit
53
54
}
54
55
89
90
90
91
if ($AzureBuildStep -ne " all" )
91
92
{
92
- # Some builds have "-branchname" appended, but when this happens the environment variable
93
+ # Some builds have "-branchname" appended, but when this happens the environment variable
93
94
# TFS_BUILDNUMBER has the un-modified version.
94
95
if ($env: TFS_BUILDNUMBER )
95
96
{
@@ -99,17 +100,17 @@ Try {
99
100
$yymm = $env: BUILD_BUILDNUMBER.substring ($env: BUILD_BUILDNUMBER.length - 10 , 4 )
100
101
$dd = $env: BUILD_BUILDNUMBER.substring ($env: BUILD_BUILDNUMBER.length - 5 , 2 )
101
102
$revision = $env: BUILD_BUILDNUMBER.substring ($env: BUILD_BUILDNUMBER.length - 3 , 3 )
102
-
103
+
103
104
$WindowsAppSDKVersionProperty = " /p:WindowsAppSDKVersionBuild=$yymm /p:WindowsAppSDKVersionRevision=$dd$revision "
104
-
105
+
105
106
# If $AzureBuildStep is not "all", that means we are in the pipeline
106
107
$WindowsAppSDKBuildPipeline = 1
107
108
}
108
- # PreFastSetup is specifically for use when preparing for PREFast scans. It triggers the same actions below as BuildBinaries or BuildMRT, except
109
- # PreFastSetup stops short of calling msBuild.exe to build the target, which the Guardian:PREFast task does _not_ support, so the caller of this
110
- # script needs to resort to calling the MSBuild/VSBuild task later to build the target, which the Guardian:PREFast task does support. Structuring
109
+ # PreFastSetup is specifically for use when preparing for PREFast scans. It triggers the same actions below as BuildBinaries or BuildMRT, except
110
+ # PreFastSetup stops short of calling msBuild.exe to build the target, which the Guardian:PREFast task does _not_ support, so the caller of this
111
+ # script needs to resort to calling the MSBuild/VSBuild task later to build the target, which the Guardian:PREFast task does support. Structuring
111
112
# the code this way allows minimally diveraging the flow while supporting building the target both via this script and the VSBuild/MSBuild task.
112
- if (($AzureBuildStep -eq " all" ) -Or (($AzureBuildStep -eq " BuildBinaries" ) -Or ($AzureBuildStep -eq " BuildMRT" ) -Or ($AzureBuildStep -eq " PreFastSetup" )))
113
+ if (($AzureBuildStep -eq " all" ) -Or (($AzureBuildStep -eq " BuildBinaries" ) -Or ($AzureBuildStep -eq " BuildMRT" ) -Or ($AzureBuildStep -eq " PreFastSetup" )))
113
114
{
114
115
& .\.nuget\nuget.exe restore WindowsAppRuntime.sln - configfile NuGet.config
115
116
@@ -148,7 +149,7 @@ Try {
148
149
}
149
150
}
150
151
# PreFastSetup intentionally skips the call to MSBuild.exe below.
151
- if (($AzureBuildStep -eq " all" ) -Or ($AzureBuildStep -eq " BuildBinaries" ))
152
+ if (($AzureBuildStep -eq " all" ) -Or ($AzureBuildStep -eq " BuildBinaries" ))
152
153
{
153
154
foreach ($configurationToRun in $configuration.Split (" ," ))
154
155
{
@@ -172,7 +173,7 @@ Try {
172
173
}
173
174
}
174
175
}
175
- if (($AzureBuildStep -eq " all" ) -Or ($AzureBuildStep -eq " BuildMRT" ) -Or ($AzureBuildStep -eq " PreFastSetup" ))
176
+ if (($AzureBuildStep -eq " all" ) -Or ($AzureBuildStep -eq " BuildMRT" ) -Or ($AzureBuildStep -eq " PreFastSetup" ))
176
177
{
177
178
# ------------------
178
179
# Build mrtcore.sln and move output to staging.
@@ -231,7 +232,7 @@ Try {
231
232
}
232
233
233
234
# PreFastSetup intentionally skips the call to MSBuild.exe below.
234
- if (($AzureBuildStep -eq " all" ) -Or ($AzureBuildStep -eq " BuildMRT" ))
235
+ if (($AzureBuildStep -eq " all" ) -Or ($AzureBuildStep -eq " BuildMRT" ))
235
236
{
236
237
# Build mrt core.
237
238
foreach ($configurationToRun in $configuration.Split (" ," ))
@@ -253,7 +254,7 @@ Try {
253
254
}
254
255
}
255
256
}
256
- if (($AzureBuildStep -eq " all" ) -Or ($AzureBuildStep -eq " BuildAnyCPU" ))
257
+ if (($AzureBuildStep -eq " all" ) -Or ($AzureBuildStep -eq " BuildAnyCPU" ))
257
258
{
258
259
# ------------------
259
260
# Build windowsAppRuntime.sln (anyCPU) and move output to staging.
@@ -266,13 +267,13 @@ Try {
266
267
exit 1
267
268
}
268
269
}
269
- if (($AzureBuildStep -eq " all" ) -Or ($AzureBuildStep -eq " StageFiles" ))
270
+ if (($AzureBuildStep -eq " all" ) -Or ($AzureBuildStep -eq " StageFiles" ))
270
271
{
271
272
# ------------------
272
273
# Stage files for Packing
273
- # ------------------
274
+ # ------------------
274
275
if (-not (test-path " $BasePath " ))
275
- {
276
+ {
276
277
new-item - path " $BasePath " - itemtype " directory"
277
278
}
278
279
@@ -322,7 +323,7 @@ Try {
322
323
Copy-Item - path " BuildOutput\$configurationForMrtAndAnyCPU \$platformToRun \mrm\MRM.pdb" - destination " $BasePath \runtimes\win10-$platformToRun \native" - force
323
324
Copy-Item - path " BuildOutput\$configurationForMrtAndAnyCPU \$platformToRun \Microsoft.Windows.ApplicationModel.Resources\Microsoft.Windows.ApplicationModel.Resources.pdb" - destination " $BasePath \runtimes\win10-$platformToRun \native" - force
324
325
Copy-Item - path " BuildOutput\$configurationForMrtAndAnyCPU \$platformToRun \Microsoft.Windows.ApplicationModel.Resources\Microsoft.Windows.ApplicationModel.Resources.dll" - destination " $BasePath \runtimes\win10-$platformToRun \native" - force
325
-
326
+
326
327
Copy-Item - path " BuildOutput\$configurationForMrtAndAnyCPU \$platformToRun \mrm\MRM.lib" - destination " $BasePath \lib\win10-$platformToRun " - force
327
328
328
329
if ($platformToRun -eq " x86" )
@@ -389,9 +390,9 @@ Try {
389
390
exit 1
390
391
}
391
392
}
392
- if (($AzureBuildStep -eq " all" ) -Or ($AzureBuildStep -eq " PackNuget" ))
393
+ if (($AzureBuildStep -eq " all" ) -Or ($AzureBuildStep -eq " PackNuget" ))
393
394
{
394
- $nuspecPath = " BuildOutput\Microsoft.WindowsAppSDK.Foundation.nuspec"
395
+ $nuspecPath = " BuildOutput\Microsoft.WindowsAppSDK.Foundation.nuspec"
395
396
Copy-Item - Path " .\build\NuSpecs\Microsoft.WindowsAppSDK.Foundation.nuspec" - Destination $nuspecPath
396
397
397
398
# Add the version to the nuspec.
@@ -408,8 +409,8 @@ Try {
408
409
exit 1
409
410
}
410
411
}
411
- }
412
- Catch
412
+ }
413
+ Catch
413
414
{
414
415
$formatstring = " `n {0}`n`n {1}`n`n "
415
416
$fields = $_ , $_.ScriptStackTrace
0 commit comments