Skip to content

Commit

Permalink
Cherry Pick Fixes to Main (microsoft#3262)
Browse files Browse the repository at this point in the history
* Update dependencies from https://dev.azure.com/microsoft/ProjectReunion/_git/ProjectReunionInternal build Maestro-UpdateEngCommon_2212.09001 (microsoft#3240)

Microsoft.WinAppSDK.EngCommon
 From Version 1.2.220923.2 -> To Version 1.3.221209100

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>

* Various BuildTransportPackage.ps1 Refactors and Fixes (microsoft#3221)

* Update DynamicDependencies\Test_Win* dependencies to prevent out-of-order builds (microsoft#3195)

* Remove UTF8 BOM

* Fix test\DynamicDependency\Test_Win* to include a dependency on Framework.Widgets so the build ensures proper build order

Co-authored-by: reunion-maestro[bot] <81196566+reunion-maestro[bot]@users.noreply.github.com>
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Howard Kapustein <howardk@microsoft.com>
  • Loading branch information
4 people authored Dec 16, 2022
1 parent 9edb6ff commit c346233
Show file tree
Hide file tree
Showing 15 changed files with 745 additions and 42 deletions.
2 changes: 1 addition & 1 deletion BuildTransportPackage.cmd → BuildAll.cmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@echo off

powershell -ExecutionPolicy Unrestricted -NoLogo -NoProfile -File %~dp0\BuildTransportPackage.ps1 %*
powershell -ExecutionPolicy Unrestricted -NoLogo -NoProfile -File %~dp0\BuildAll.ps1 %*

exit /b %ERRORLEVEL%
53 changes: 48 additions & 5 deletions BuildTransportPackage.ps1 → BuildAll.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,10 @@ Try {
& .\.nuget\nuget.exe restore WindowsAppRuntime.sln -configfile nuget.config
& .\.nuget\nuget.exe restore "dev\Bootstrap\CS\Microsoft.WindowsAppRuntime.Bootstrap.Net\Microsoft.WindowsAppRuntime.Bootstrap.Net.csproj" -configfile nuget.config

# If the call to restore WindowsAppRuntime_Insights fails check to make sure all Window SDK's from 17760 are installed.
& .\.nuget\nuget.exe restore "dev\WindowsAppRuntime_Insights\packages.config" -ConfigFile "dev\WindowsAppRuntime_Insights\nuget.config" -PackagesDirectory "dev\WindowsAppRuntime_Insights\packages"
if ($lastexitcode -ne 0)
{
exit 1
}

$srcPath = Get-Childitem -Path 'dev\WindowsAppRuntime_Insights\packages' -File 'MicrosoftTelemetry.h' -Recurse

Expand All @@ -127,6 +129,11 @@ Try {
}
}
}

if ($lastexitcode -ne 0)
{
exit 1
}
}
if (($AzureBuildStep -eq "all") -Or ($AzureBuildStep -eq "BuildBinaries"))
{
Expand All @@ -144,6 +151,10 @@ Try {
/p:WindowsAppSDKCleanIntermediateFiles=true `
/p:AppxSymbolPackageEnabled=false `
/p:WindowsAppSDKBuildPipeline=$WindowsAppSDKBuildPipeline
if ($lastexitcode -ne 0)
{
exit 1
}
}
}
}
Expand All @@ -154,12 +165,17 @@ Try {
#------------------

#Restore packages from mrt.
& .\.nuget\nuget.exe restore "$MRTSourcesDirectory\mrt\MrtCore.sln" -ConfigFile nuget.config
& .\.nuget\nuget.exe restore "$MRTSourcesDirectory\mrt\MrtCore.sln" -ConfigFile nuget.config -PackagesDirectory "$MRTSourcesDirectory\mrt\packages"
& .\.nuget\nuget.exe restore "$MRTSourcesDirectory\mrt\Microsoft.Windows.ApplicationModel.Resources\src\packages.config" -ConfigFile nuget.config -PackagesDirectory "$MRTSourcesDirectory\mrt\packages"
& .\.nuget\nuget.exe restore "$MRTSourcesDirectory\mrt\mrm\mrmex\packages.config" -ConfigFile nuget.config -PackagesDirectory "$MRTSourcesDirectory\mrt\packages"
& .\.nuget\nuget.exe restore "$MRTSourcesDirectory\mrt\mrm\mrmmin\packages.config" -ConfigFile nuget.config -PackagesDirectory "$MRTSourcesDirectory\mrt\packages"
& .\.nuget\nuget.exe restore "$MRTSourcesDirectory\mrt\mrm\unittests\packages.config" -ConfigFile nuget.config -PackagesDirectory "$MRTSourcesDirectory\mrt\packages"

if ($lastexitcode -ne 0)
{
exit 1
}

# Init mrtcore
foreach($platformToRun in $platform.Split(","))
{
Expand All @@ -172,11 +188,15 @@ Try {
foreach($platformToRun in $platform.Split(","))
{
write-host "Building MrtCore.sln for configuration $configurationToRun and platform:$platformToRun"
& $msBuildPath /restore `
"$MRTSourcesDirectory\mrt\MrtCore.sln" `
& $msBuildPath /restore "$MRTSourcesDirectory\mrt\MrtCore.sln" `
/p:Configuration=$configurationToRun,Platform=$platformToRun `
/p:PGOBuildMode=$PGOBuildMode `
/binaryLogger:"BuildOutput/mrtcore.$platformToRun.$configurationToRun.binlog"

if ($lastexitcode -ne 0)
{
exit 1
}
}
}
}
Expand All @@ -187,6 +207,10 @@ Try {
#------------------
# build AnyCPU
& $msBuildPath /restore "dev\Bootstrap\CS\Microsoft.WindowsAppRuntime.Bootstrap.Net\Microsoft.WindowsAppRuntime.Bootstrap.Net.csproj" /p:Configuration=$configurationForMrtAndAnyCPU,Platform=AnyCPU
if ($lastexitcode -ne 0)
{
exit 1
}
}
if (($AzureBuildStep -eq "all") -Or ($AzureBuildStep -eq "StageFiles"))
{
Expand All @@ -209,6 +233,10 @@ Try {
foreach($platformToRun in $platform.Split(","))
{
.\build\CopyFilesToStagingDir.ps1 -BuildOutputDir 'BuildOutput' -OverrideDir "$buildOverridePath" -PublishDir "$windowsAppSdkBinariesPath" -NugetDir "$BasePath" -Platform $PlatformToRun -Configuration $ConfigurationToRun
if ($lastexitcode -ne 0)
{
exit 1
}
}
}

Expand Down Expand Up @@ -276,6 +304,11 @@ Try {
Copy-Item -Path "$nuSpecsPath\AppxManifest.xml" -Destination "$BasePath"
Copy-Item -Path "LICENSE" -Destination "$BasePath" -force

if ($lastexitcode -ne 0)
{
exit 1
}

# for some reason xslt.load changes the working directory to C:\windows\system32.
# store the current working directory here.
$workingDirectory = get-location
Expand All @@ -286,6 +319,11 @@ Try {
$xslt = New-Object System.Xml.Xsl.XslCompiledTransform
$xslt.Load("$workingDirectory\build\TransformAppxManifest.xslt")
$xslt.Transform("$workingDirectory\$BasePath\AppxManifest.xml", "$workingDirectory\$manifestPath\Microsoft.WindowsAppSdk.Foundation.manifest")

if ($lastexitcode -ne 0)
{
exit 1
}
}
if (($AzureBuildStep -eq "all") -Or ($AzureBuildStep -eq "PackNuget"))
{
Expand All @@ -299,6 +337,11 @@ Try {

# Make the foundation transport package.
& .\.nuget\nuget.exe pack $nuspecPath -BasePath $BasePath -OutputDirectory $OutputDirectory

if ($lastexitcode -ne 0)
{
exit 1
}
}
}
Catch
Expand Down
4 changes: 2 additions & 2 deletions DevCheck.cmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@echo off
@echo off

powershell -ExecutionPolicy Unrestricted -NoLogo -NoProfile -File %~dp0\DevCheck.ps1 %*

exit /b %ERRORLEVEL%
exit /b %ERRORLEVEL%
2 changes: 2 additions & 0 deletions WindowsAppRuntime.sln
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DynamicDependency", "Dynami
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DynamicDependency_Test_Win32", "test\DynamicDependency\Test_Win32\DynamicDependency_Test_Win32.vcxproj", "{6BAC3B29-3A6B-4B3F-A9AB-A316AA4E48ED}"
ProjectSection(ProjectDependencies) = postProject
{09DDAE21-397F-4263-8561-7F2FF28127CF} = {09DDAE21-397F-4263-8561-7F2FF28127CF}
{58E95711-A12F-4C0E-A978-C6B4A0842AC8} = {58E95711-A12F-4C0E-A978-C6B4A0842AC8}
{66D0D8B1-FAF4-4C6A-8303-07F3BA356FE3} = {66D0D8B1-FAF4-4C6A-8303-07F3BA356FE3}
{B73AD907-6164-4294-88FB-F3C9C10DA1F1} = {B73AD907-6164-4294-88FB-F3C9C10DA1F1}
Expand Down Expand Up @@ -93,6 +94,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IDynamicDependencyLifetimeM
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DynamicDependency_Test_WinRT", "test\DynamicDependency\Test_WinRT\DynamicDependency_Test_WinRT.vcxproj", "{B2546322-D329-4F6C-9C2E-7EFC3C9ED214}"
ProjectSection(ProjectDependencies) = postProject
{09DDAE21-397F-4263-8561-7F2FF28127CF} = {09DDAE21-397F-4263-8561-7F2FF28127CF}
{58E95711-A12F-4C0E-A978-C6B4A0842AC8} = {58E95711-A12F-4C0E-A978-C6B4A0842AC8}
{66D0D8B1-FAF4-4C6A-8303-07F3BA356FE3} = {66D0D8B1-FAF4-4C6A-8303-07F3BA356FE3}
{B73AD907-6164-4294-88FB-F3C9C10DA1F1} = {B73AD907-6164-4294-88FB-F3C9C10DA1F1}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ steps:
- task: PowerShell@2
name: BuildBinaries
inputs:
filePath: 'BuildTransportPackage.ps1'
filePath: 'BuildAll.ps1'
arguments: -Platform "$(buildPlatform)" -Configuration "$(buildConfiguration)" -AzureBuildStep "BuildMRT"

# component detection must happen *within* the build task
Expand Down
26 changes: 22 additions & 4 deletions build/ProjectReunion-BuildFoundation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ jobs:
inputs:
nuGetServiceConnections: 'TelemetryInternal'

- task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2
displayName: 'NuGet restore of packages'
inputs:
command: 'custom'
arguments: 'restore dev\WindowsAppRuntime_Insights\packages.config -ConfigFile dev\WindowsAppRuntime_Insights\nuget.config -PackagesDirectory dev\WindowsAppRuntime_Insights\packages'

- template: AzurePipelinesTemplates\WindowsAppSDK-SetupBuildEnvironment-Steps.yml

- task: NuGetAuthenticate@1
Expand Down Expand Up @@ -118,7 +124,7 @@ jobs:
- task: PowerShell@2
name: BuildBinaries
inputs:
filePath: 'BuildTransportPackage.ps1'
filePath: 'BuildAll.ps1'
arguments: -Platform "$(buildPlatform)" -Configuration "$(buildConfiguration)" -AzureBuildStep "BuildBinaries"

# component detection must happen *within* the build task
Expand Down Expand Up @@ -153,12 +159,18 @@ jobs:
inputs:
nuGetServiceConnections: 'TelemetryInternal'

- task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2
displayName: 'NuGet restore of packages'
inputs:
command: 'custom'
arguments: 'restore dev\WindowsAppRuntime_Insights\packages.config -ConfigFile dev\WindowsAppRuntime_Insights\nuget.config -PackagesDirectory dev\WindowsAppRuntime_Insights\packages'

- template: AzurePipelinesTemplates\WindowsAppSDK-SetupBuildEnvironment-Steps.yml

- task: PowerShell@2
name: BuildBinaries
inputs:
filePath: 'BuildTransportPackage.ps1'
filePath: 'BuildAll.ps1'
arguments: -AzureBuildStep "BuildAnyCPU"

- ${{ if eq(parameters.RunSDLBinaryAnalysis, 'true') }}:
Expand Down Expand Up @@ -216,6 +228,12 @@ jobs:
inputs:
nuGetServiceConnections: 'TelemetryInternal'

- task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2
displayName: 'NuGet restore of packages'
inputs:
command: 'custom'
arguments: 'restore dev\WindowsAppRuntime_Insights\packages.config -ConfigFile dev\WindowsAppRuntime_Insights\nuget.config -PackagesDirectory dev\WindowsAppRuntime_Insights\packages'

- template: AzurePipelinesTemplates\WindowsAppSDK-BuildAndTestMRT-Steps.yml

- ${{ if eq(parameters.RunSDLBinaryAnalysis, 'true') }}:
Expand Down Expand Up @@ -265,7 +283,7 @@ jobs:
- task: PowerShell@2
name: StageFiles
inputs:
filePath: 'BuildTransportPackage.ps1'
filePath: 'BuildAll.ps1'
arguments: -Platform "x86,x64,arm64" -Configuration "release" -AzureBuildStep "StageFiles"

- task: EsrpCodeSigning@1
Expand Down Expand Up @@ -376,7 +394,7 @@ jobs:
- task: PowerShell@2
name: PackNuget
inputs:
filePath: 'BuildTransportPackage.ps1'
filePath: 'BuildAll.ps1'
arguments: -Platform "x64" -Configuration "release" -AzureBuildStep "PackNuget" -OutputDirectory "$(build.artifactStagingDirectory)\FullNuget" -PackageVersion "$(packageVersion)"

- task: EsrpCodeSigning@1
Expand Down
8 changes: 4 additions & 4 deletions build/ProjectReunion-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
- task: PowerShell@2
name: BuildBinaries
inputs:
filePath: 'BuildTransportPackage.ps1'
filePath: 'BuildAll.ps1'
arguments: -Platform "$(buildPlatform)" -Configuration "$(buildConfiguration)" -AzureBuildStep "BuildBinaries"

- task: PublishBuildArtifacts@1
Expand All @@ -108,7 +108,7 @@ jobs:
- task: PowerShell@2
name: BuildBinaries
inputs:
filePath: 'BuildTransportPackage.ps1'
filePath: 'BuildAll.ps1'
arguments: -AzureBuildStep "BuildAnyCPU"

- task: PublishBuildArtifacts@1
Expand Down Expand Up @@ -167,7 +167,7 @@ jobs:
- task: PowerShell@2
name: StageFiles
inputs:
filePath: 'BuildTransportPackage.ps1'
filePath: 'BuildAll.ps1'
arguments: -Platform "x86,x64,arm64" -Configuration "release" -AzureBuildStep "StageFiles"

- task: PowerShell@2
Expand All @@ -192,7 +192,7 @@ jobs:
- task: PowerShell@2
name: PackNuget
inputs:
filePath: 'BuildTransportPackage.ps1'
filePath: 'BuildAll.ps1'
arguments: -Platform "x64" -Configuration "release" -AzureBuildStep "PackNuget" -OutputDirectory "$(build.artifactStagingDirectory)\FullNuget" -PackageVersion "$(packageVersion)"

- task: BinSkim@3
Expand Down
18 changes: 0 additions & 18 deletions build_all.cmd

This file was deleted.

4 changes: 2 additions & 2 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
<Uri>https://github.com/microsoft/CsWinRT</Uri>
<Sha>fa7f5565cb53353dc15c28a09ebd500577dc0b72</Sha>
</Dependency>
<Dependency Name="Microsoft.WinAppSDK.EngCommon" Version="1.2.220923.2">
<Dependency Name="Microsoft.WinAppSDK.EngCommon" Version="1.3.221209100">
<Uri>https://dev.azure.com/microsoft/ProjectReunion/_git/ProjectReunionInternal</Uri>
<Sha>2d121ebc5bb8953726f46337535f28a2e0292734</Sha>
<Sha>f595a1e3c825d944ff5f097cd1941dfe27447d7e</Sha>
</Dependency>
</ToolsetDependencies>
</Dependencies>
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,24 @@ steps:
SecretsFilter: 'TestMSCert'
RunAsPreJob: false

# Setup for MyCert.pfx
# Setup for winappsdk.certificate.test.pfx
- task: PowerShell@2
name: CreateCert
displayName: Create MyCert.pfx
displayName: Create winappsdk.certificate.test.pfx
inputs:
targetType: 'inline'
script: |
$userPath = Join-Path $env:Build_SourcesDirectory ".user"
mkdir -Force $userPath | Out-Null
$kvSecretBytes = [System.Convert]::FromBase64String("$(TestMSCert)")
$certCollection = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2Collection
$certCollection.Import($kvSecretBytes,$null,[System.Security.Cryptography.X509Certificates.X509KeyStorageFlags]::Exportable)
$certificateBytes = $certCollection.Export([System.Security.Cryptography.X509Certificates.X509ContentType]::Pkcs12)
$pfxPath = (Join-Path $env:Build_SourcesDirectory 'MyCert.pfx')
$pfxPath = (Join-Path $userPath 'winappsdk.certificate.test.pfx')
[System.IO.File]::WriteAllBytes($pfxPath, $certificateBytes)
- task: NuGetToolInstaller@1

- task: NuGetAuthenticate@1
inputs:
nuGetServiceConnections: ${{ parameters.NuGetServiceConnectionName }}
10 changes: 10 additions & 0 deletions eng/common/AzurePipelinesTemplates/WindowsAppSDK-CompilerImage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Specify a specific image from ProjectReunionESPool-2022 to use for compilation. Release/servicing branches are
# recommended to choose an LTSC image for long-term stability and security updates.
# Options are:
# - MMS2022 (default)
# (latest, updated weekly)
# - Win2022-VS17.2
# (Windows Server 2022 Datacenter with Visual Studio 17.2 LTSC)

variables:
CompilerPoolImage: 'MMS2022'
5 changes: 5 additions & 0 deletions eng/common/DevCheck.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@echo off

powershell -ExecutionPolicy Unrestricted -NoLogo -NoProfile -File %~dp0\DevCheck.ps1 %*

exit /b %ERRORLEVEL%
Loading

0 comments on commit c346233

Please sign in to comment.