Skip to content

Commit 034544d

Browse files
committed
Merge branch 'release/1.4-stable' of https://github.com/microsoft/WindowsAppSDK
2 parents 651c23e + 96b3638 commit 034544d

File tree

213 files changed

+7763
-1261
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

213 files changed

+7763
-1261
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,8 @@ PublishScripts/
210210
# NuGet v3's project.json files produces more ignorable files
211211
*.nuget.props
212212
*.nuget.targets
213+
# except our intentionally checked in local repository
214+
!tools/nuget/*.nupkg
213215

214216
# Microsoft Azure Build Output
215217
csx/

BuildAll.ps1

Lines changed: 106 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@ UpdateVersionDetailsPath: Path to a ps1 or cmd that updates version.details.xml.
1111
Clean: Performs a clean on BuildOutput, Obj, and build\override
1212
1313
Note about building in different environments.
14-
The feed the nuget.config points to changes depending on the branch.
14+
The feed the NuGet.config points to changes depending on the branch.
1515
Develop branch points to the internal feed.
1616
Main branch points to the external feed.
17-
1817
#>
1918

2019
Param(
@@ -33,23 +32,24 @@ $buildOverridePath = "build\override"
3332
$BasePath = "BuildOutput/FullNuget"
3433

3534
# FUTURE(YML2PS): Update build to no longer place generated files in sources directory
36-
if ($Clean)
35+
if ($Clean)
3736
{
3837
$CleanTargets = @(
3938
"BuildOutput",
4039
"obj",
40+
".user",
4141
$buildOverridePath
4242
)
43-
43+
4444
foreach ($CleanTarget in $CleanTargets)
4545
{
4646
$CleanTargetPath = (Join-Path $env:Build_SourcesDirectory $CleanTarget)
47-
47+
4848
if (Test-Path ($CleanTargetPath)) {
4949
Remove-Item $CleanTargetPath -recurse
5050
}
5151
}
52-
52+
5353
Exit
5454
}
5555

@@ -68,7 +68,7 @@ if(-not (test-path ".nuget\nuget.exe"))
6868
$configurationForMrtAndAnyCPU = "Release"
6969
$MRTSourcesDirectory = "dev\MRTCore"
7070

71-
$VCToolsInstallDir = . "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -Latest -requires Microsoft.Component.MSBuild -property InstallationPath
71+
$VCToolsInstallDir = . "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -Latest -prerelease -requires Microsoft.Component.MSBuild -property InstallationPath
7272
write-host "VCToolsInstallDir: $VCToolsInstallDir"
7373

7474
$msBuildPath = "$VCToolsInstallDir\MSBuild\Current\Bin\msbuild.exe"
@@ -90,7 +90,7 @@ Try {
9090

9191
if ($AzureBuildStep -ne "all")
9292
{
93-
# 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
9494
# TFS_BUILDNUMBER has the un-modified version.
9595
if ($env:TFS_BUILDNUMBER)
9696
{
@@ -100,19 +100,31 @@ Try {
100100
$yymm = $env:BUILD_BUILDNUMBER.substring($env:BUILD_BUILDNUMBER.length - 10, 4)
101101
$dd = $env:BUILD_BUILDNUMBER.substring($env:BUILD_BUILDNUMBER.length - 5, 2)
102102
$revision = $env:BUILD_BUILDNUMBER.substring($env:BUILD_BUILDNUMBER.length - 3, 3)
103-
103+
104104
$WindowsAppSDKVersionProperty = "/p:WindowsAppSDKVersionBuild=$yymm /p:WindowsAppSDKVersionRevision=$dd$revision"
105-
105+
106106
# If $AzureBuildStep is not "all", that means we are in the pipeline
107107
$WindowsAppSDKBuildPipeline = 1
108108
}
109-
if (($AzureBuildStep -eq "all") -Or (($AzureBuildStep -eq "BuildBinaries") -Or ($AzureBuildStep -eq "BuildMRT")))
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
112+
# the code this way allows minimally diveraging the flow while supporting building the target both via this script and the VSBuild/MSBuild task.
113+
if (($AzureBuildStep -eq "all") -Or (($AzureBuildStep -eq "BuildBinaries") -Or ($AzureBuildStep -eq "BuildMRT") -Or ($AzureBuildStep -eq "PreFastSetup")))
110114
{
111-
& .\.nuget\nuget.exe restore WindowsAppRuntime.sln -configfile nuget.config
112-
& .\.nuget\nuget.exe restore "dev\Bootstrap\CS\Microsoft.WindowsAppRuntime.Bootstrap.Net\Microsoft.WindowsAppRuntime.Bootstrap.Net.csproj" -configfile nuget.config
115+
& .\.nuget\nuget.exe restore WindowsAppRuntime.sln -configfile NuGet.config
116+
117+
if ($lastexitcode -ne 0)
118+
{
119+
write-host "ERROR: restore WindowsAppRuntime.sln FAILED."
120+
exit 1
121+
}
122+
123+
& .\.nuget\nuget.exe restore "dev\Bootstrap\CS\Microsoft.WindowsAppRuntime.Bootstrap.Net\Microsoft.WindowsAppRuntime.Bootstrap.Net.csproj" -configfile NuGet.config
113124

114125
if ($lastexitcode -ne 0)
115126
{
127+
write-host "ERROR: restore Microsoft.WindowsAppRuntime.Bootstrap.Net.csproj FAILED."
116128
exit 1
117129
}
118130

@@ -132,10 +144,12 @@ Try {
132144

133145
if ($lastexitcode -ne 0)
134146
{
147+
write-host "ERROR: Copy-Item -Force $srcPath.FullName $destPath.FullName FAILED."
135148
exit 1
136149
}
137150
}
138-
if (($AzureBuildStep -eq "all") -Or ($AzureBuildStep -eq "BuildBinaries"))
151+
# PreFastSetup intentionally skips the call to MSBuild.exe below.
152+
if (($AzureBuildStep -eq "all") -Or ($AzureBuildStep -eq "BuildBinaries"))
139153
{
140154
foreach($configurationToRun in $configuration.Split(","))
141155
{
@@ -153,54 +167,94 @@ Try {
153167
/p:WindowsAppSDKBuildPipeline=$WindowsAppSDKBuildPipeline
154168
if ($lastexitcode -ne 0)
155169
{
170+
write-host "ERROR: msbuild.exe /restore WindowsAppRuntime.sln FAILED."
156171
exit 1
157172
}
158173
}
159174
}
160175
}
161-
if (($AzureBuildStep -eq "all") -Or ($AzureBuildStep -eq "BuildMRT"))
176+
if (($AzureBuildStep -eq "all") -Or ($AzureBuildStep -eq "BuildMRT") -Or ($AzureBuildStep -eq "PreFastSetup"))
162177
{
163178
#------------------
164179
# Build mrtcore.sln and move output to staging.
165180
#------------------
166181

167182
#Restore packages from mrt.
168-
& .\.nuget\nuget.exe restore "$MRTSourcesDirectory\mrt\MrtCore.sln" -ConfigFile nuget.config
169-
& .\.nuget\nuget.exe restore "$MRTSourcesDirectory\mrt\Microsoft.Windows.ApplicationModel.Resources\src\packages.config" -ConfigFile nuget.config
170-
& .\.nuget\nuget.exe restore "$MRTSourcesDirectory\mrt\mrm\mrmex\packages.config" -ConfigFile nuget.config
171-
& .\.nuget\nuget.exe restore "$MRTSourcesDirectory\mrt\mrm\mrmmin\packages.config" -ConfigFile nuget.config
172-
& .\.nuget\nuget.exe restore "$MRTSourcesDirectory\mrt\mrm\unittests\packages.config" -ConfigFile nuget.config
183+
& .\.nuget\nuget.exe restore "$MRTSourcesDirectory\mrt\MrtCore.sln" -ConfigFile NuGet.config
184+
185+
if ($lastexitcode -ne 0)
186+
{
187+
write-host "ERROR: restore MrtCore.sln FAILED."
188+
exit 1
189+
}
190+
191+
& .\.nuget\nuget.exe restore "$MRTSourcesDirectory\mrt\Microsoft.Windows.ApplicationModel.Resources\src\packages.config" -ConfigFile NuGet.config
192+
193+
if ($lastexitcode -ne 0)
194+
{
195+
write-host "ERROR: restore Microsoft.Windows.ApplicationModel.Resources\src\packages.config FAILED."
196+
exit 1
197+
}
198+
199+
& .\.nuget\nuget.exe restore "$MRTSourcesDirectory\mrt\mrm\mrmex\packages.config" -ConfigFile NuGet.config
200+
201+
if ($lastexitcode -ne 0)
202+
{
203+
write-host "ERROR: restore mrm\mrmex\packages.config FAILED."
204+
exit 1
205+
}
206+
207+
& .\.nuget\nuget.exe restore "$MRTSourcesDirectory\mrt\mrm\mrmmin\packages.config" -ConfigFile NuGet.config
208+
209+
if ($lastexitcode -ne 0)
210+
{
211+
write-host "ERROR: restore mrmmin\packages.config FAILED."
212+
exit 1
213+
}
214+
215+
& .\.nuget\nuget.exe restore "$MRTSourcesDirectory\mrt\mrm\unittests\packages.config" -ConfigFile NuGet.config
173216

174217
if ($lastexitcode -ne 0)
175218
{
219+
write-host "ERROR: restore unittests\packages.config FAILED."
176220
exit 1
177221
}
178222

179223
# Init mrtcore
180224
foreach($platformToRun in $platform.Split(","))
181225
{
182226
& $MRTSourcesDirectory\build\init.cmd /envonly $platformToRun\fre
227+
228+
if ($lastexitcode -ne 0)
229+
{
230+
write-host "ERROR: init.cmd /envonly $platformToRun\fre FAILED."
231+
}
183232
}
184233

185-
# Build mrt core.
186-
foreach($configurationToRun in $configuration.Split(","))
234+
# PreFastSetup intentionally skips the call to MSBuild.exe below.
235+
if (($AzureBuildStep -eq "all") -Or ($AzureBuildStep -eq "BuildMRT"))
187236
{
188-
foreach($platformToRun in $platform.Split(","))
237+
# Build mrt core.
238+
foreach($configurationToRun in $configuration.Split(","))
189239
{
190-
write-host "Building MrtCore.sln for configuration $configurationToRun and platform:$platformToRun"
191-
& $msBuildPath /restore "$MRTSourcesDirectory\mrt\MrtCore.sln" `
192-
/p:Configuration=$configurationToRun,Platform=$platformToRun `
193-
/p:PGOBuildMode=$PGOBuildMode `
194-
/binaryLogger:"BuildOutput/mrtcore.$platformToRun.$configurationToRun.binlog"
195-
196-
if ($lastexitcode -ne 0)
240+
foreach($platformToRun in $platform.Split(","))
197241
{
198-
exit 1
242+
write-host "Building MrtCore.sln for configuration $configurationToRun and platform:$platformToRun"
243+
& $msBuildPath /restore "$MRTSourcesDirectory\mrt\MrtCore.sln" `
244+
/p:Configuration=$configurationToRun,Platform=$platformToRun `
245+
/p:PGOBuildMode=$PGOBuildMode `
246+
/binaryLogger:"BuildOutput/mrtcore.$platformToRun.$configurationToRun.binlog"
247+
248+
if ($lastexitcode -ne 0)
249+
{
250+
write-host "ERROR: msbuild restore '$MRTSourcesDirectory\mrt\MrtCore.sln' FAILED."
251+
exit 1
252+
}
199253
}
200254
}
201255
}
202256
}
203-
if (($AzureBuildStep -eq "all") -Or ($AzureBuildStep -eq "BuildAnyCPU"))
257+
if (($AzureBuildStep -eq "all") -Or ($AzureBuildStep -eq "BuildAnyCPU"))
204258
{
205259
#------------------
206260
# Build windowsAppRuntime.sln (anyCPU) and move output to staging.
@@ -209,16 +263,17 @@ Try {
209263
& $msBuildPath /restore "dev\Bootstrap\CS\Microsoft.WindowsAppRuntime.Bootstrap.Net\Microsoft.WindowsAppRuntime.Bootstrap.Net.csproj" /p:Configuration=$configurationForMrtAndAnyCPU,Platform=AnyCPU
210264
if ($lastexitcode -ne 0)
211265
{
266+
write-host "ERROR: msbuild restore Microsoft.WindowsAppRuntime.Bootstrap.Net.csproj FAILED."
212267
exit 1
213268
}
214269
}
215-
if (($AzureBuildStep -eq "all") -Or ($AzureBuildStep -eq "StageFiles"))
270+
if (($AzureBuildStep -eq "all") -Or ($AzureBuildStep -eq "StageFiles"))
216271
{
217272
#------------------
218273
# Stage files for Packing
219-
#------------------
274+
#------------------
220275
if(-not (test-path "$BasePath"))
221-
{
276+
{
222277
new-item -path "$BasePath" -itemtype "directory"
223278
}
224279

@@ -235,6 +290,7 @@ Try {
235290
.\build\CopyFilesToStagingDir.ps1 -BuildOutputDir 'BuildOutput' -OverrideDir "$buildOverridePath" -PublishDir "$windowsAppSdkBinariesPath" -NugetDir "$BasePath" -Platform $PlatformToRun -Configuration $ConfigurationToRun
236291
if ($lastexitcode -ne 0)
237292
{
293+
write-host "ERROR: msCopyFilesToStagingDir.ps1 FAILED."
238294
exit 1
239295
}
240296
}
@@ -267,7 +323,7 @@ Try {
267323
Copy-Item -path "BuildOutput\$configurationForMrtAndAnyCPU\$platformToRun\mrm\MRM.pdb" -destination "$BasePath\runtimes\win10-$platformToRun\native" -force
268324
Copy-Item -path "BuildOutput\$configurationForMrtAndAnyCPU\$platformToRun\Microsoft.Windows.ApplicationModel.Resources\Microsoft.Windows.ApplicationModel.Resources.pdb" -destination "$BasePath\runtimes\win10-$platformToRun\native" -force
269325
Copy-Item -path "BuildOutput\$configurationForMrtAndAnyCPU\$platformToRun\Microsoft.Windows.ApplicationModel.Resources\Microsoft.Windows.ApplicationModel.Resources.dll" -destination "$BasePath\runtimes\win10-$platformToRun\native" -force
270-
326+
271327
Copy-Item -path "BuildOutput\$configurationForMrtAndAnyCPU\$platformToRun\mrm\MRM.lib" -destination "$BasePath\lib\win10-$platformToRun" -force
272328

273329
if($platformToRun -eq "x86")
@@ -302,10 +358,18 @@ Try {
302358
#------------------
303359

304360
Copy-Item -Path "$nuSpecsPath\AppxManifest.xml" -Destination "$BasePath"
361+
362+
if ($lastexitcode -ne 0)
363+
{
364+
write-host "ERROR: Copy-Item -Path AppxManifest.xml FAILED."
365+
exit 1
366+
}
367+
305368
Copy-Item -Path "LICENSE" -Destination "$BasePath" -force
306369

307370
if ($lastexitcode -ne 0)
308371
{
372+
write-host "ERROR: Copy-Item -Path LICENSE FAILED."
309373
exit 1
310374
}
311375

@@ -322,12 +386,13 @@ Try {
322386

323387
if ($lastexitcode -ne 0)
324388
{
389+
write-host "ERROR: xslt.Transform FAILED."
325390
exit 1
326391
}
327392
}
328-
if (($AzureBuildStep -eq "all") -Or ($AzureBuildStep -eq "PackNuget"))
393+
if (($AzureBuildStep -eq "all") -Or ($AzureBuildStep -eq "PackNuget"))
329394
{
330-
$nuspecPath = "BuildOutput\Microsoft.WindowsAppSDK.Foundation.nuspec"
395+
$nuspecPath = "BuildOutput\Microsoft.WindowsAppSDK.Foundation.nuspec"
331396
Copy-Item -Path ".\build\NuSpecs\Microsoft.WindowsAppSDK.Foundation.nuspec" -Destination $nuspecPath
332397

333398
# Add the version to the nuspec.
@@ -340,11 +405,12 @@ Try {
340405

341406
if ($lastexitcode -ne 0)
342407
{
408+
write-host "ERROR: nuget.exe pack $nuspecPath FAILED."
343409
exit 1
344410
}
345411
}
346-
}
347-
Catch
412+
}
413+
Catch
348414
{
349415
$formatstring = "`n{0}`n`n{1}`n`n"
350416
$fields = $_, $_.ScriptStackTrace

0 commit comments

Comments
 (0)