diff --git a/BuildAll.ps1 b/BuildAll.ps1 index 5e621d95d2..7c4fc0751b 100644 --- a/BuildAll.ps1 +++ b/BuildAll.ps1 @@ -77,7 +77,6 @@ write-host "VCToolsInstallDir: $VCToolsInstallDir" $msBuildPath = "$VCToolsInstallDir\MSBuild\Current\Bin\msbuild.exe" write-host "msBuildPath: $msBuildPath" - # Generate overrides # Make sure override directory exists. if(-not (test-path "$buildOverridePath")) @@ -85,6 +84,20 @@ if(-not (test-path "$buildOverridePath")) new-item -path "$buildOverridePath" -itemtype "directory" } +function NugetRestore([string] $Label, [string] $Target) +{ + if ($AzureBuildStep -ne "all") + { + $env:NUGET_RESTORE_MSBUILD_ARGS = "/binaryLogger:BuildOutput\binlogs\$Label.restore.$Platform.$Configuration.binlog /p:Platform=$Platform /p:Configuration=$Configuration" + } + & .\.nuget\nuget.exe restore $Target -configfile NuGet.config + if ($lastexitcode -ne 0) + { + write-host "ERROR: nuget.exe restore $Label FAILED." + exit 1 + } +} + Try { $WindowsAppSDKBuildPipeline = 0 @@ -109,34 +122,23 @@ Try { # If $AzureBuildStep is not "all", that means we are in the pipeline $WindowsAppSDKBuildPipeline = 1 } - # PreFastSetup is specifically for use when preparing for PREFast scans. It triggers the same actions below as BuildBinaries or BuildMRT, except + # PreFastSetup is specifically for use when preparing for PREFast scans. It triggers the same actions below as BuildFoundation or BuildMRT, except # PreFastSetup stops short of calling msBuild.exe to build the target, which the Guardian:PREFast task does _not_ support, so the caller of this # script needs to resort to calling the MSBuild/VSBuild task later to build the target, which the Guardian:PREFast task does support. Structuring # the code this way allows minimally diveraging the flow while supporting building the target both via this script and the VSBuild/MSBuild task. - if (($AzureBuildStep -eq "all") -Or (($AzureBuildStep -eq "BuildBinaries") -Or ($AzureBuildStep -eq "BuildMRT") -Or ($AzureBuildStep -eq "PreFastSetup"))) + if (($AzureBuildStep -eq "all") -Or (($AzureBuildStep -eq "BuildFoundation") -Or ($AzureBuildStep -eq "BuildMRT") -Or ($AzureBuildStep -eq "PreFastSetup"))) { - & .\.nuget\nuget.exe restore WindowsAppRuntime.sln -configfile NuGet.config - - if ($lastexitcode -ne 0) - { - write-host "ERROR: restore WindowsAppRuntime.sln FAILED." - exit 1 - } - - & .\.nuget\nuget.exe restore "dev\Bootstrap\CS\Microsoft.WindowsAppRuntime.Bootstrap.Net\Microsoft.WindowsAppRuntime.Bootstrap.Net.csproj" -configfile NuGet.config - - if ($lastexitcode -ne 0) - { - write-host "ERROR: restore Microsoft.WindowsAppRuntime.Bootstrap.Net.csproj FAILED." - exit 1 - } + NugetRestore "WindowsAppRuntime" "WindowsAppRuntime.sln" + NugetRestore "Microsoft.WindowsAppRuntime.Bootstrap.Net" "dev\Bootstrap\CS\Microsoft.WindowsAppRuntime.Bootstrap.Net\Microsoft.WindowsAppRuntime.Bootstrap.Net.csproj" $srcPath = Get-Childitem -Path 'dev\WindowsAppRuntime_Insights\packages' -File 'MicrosoftTelemetry.h' -Recurse - if (($srcPath -ne $null)){ + if (($srcPath -ne $null)) + { $destinationPaths = Get-Childitem -Path 'packages' -File 'Traceloggingconfig.h' -Recurse - if (($destinationPaths -ne $null)) { + if (($destinationPaths -ne $null)) + { foreach ($destPath in $destinationPaths) { Write-Host 'SourcePath:' $srcPath.FullName Write-Host 'DestinationPath:' $destPath.FullName @@ -152,7 +154,7 @@ Try { } } # PreFastSetup intentionally skips the call to MSBuild.exe below. - if (($AzureBuildStep -eq "all") -Or ($AzureBuildStep -eq "BuildBinaries")) + if (($AzureBuildStep -eq "all") -Or ($AzureBuildStep -eq "BuildFoundation")) { foreach($configurationToRun in $configuration.Split(",")) { @@ -162,7 +164,7 @@ Try { & $msBuildPath /restore ` WindowsAppRuntime.sln ` /p:Configuration=$configurationToRun,Platform=$platformToRun ` - /binaryLogger:"BuildOutput/WindowsAppRuntime.$platformToRun.$configurationToRun.binlog" ` + /binaryLogger:"BuildOutput/binlogs/WindowsAppRuntime.$platformToRun.$configurationToRun.binlog" ` $WindowsAppSDKVersionProperty ` /p:PGOBuildMode=$PGOBuildMode ` /p:WindowsAppSDKCleanIntermediateFiles=true ` @@ -170,7 +172,7 @@ Try { /p:WindowsAppSDKBuildPipeline=$WindowsAppSDKBuildPipeline if ($lastexitcode -ne 0) { - write-host "ERROR: msbuild.exe /restore WindowsAppRuntime.sln FAILED." + write-host "ERROR: msbuild.exe WindowsAppRuntime.sln FAILED." exit 1 } } @@ -183,45 +185,11 @@ Try { #------------------ #Restore packages from mrt. - & .\.nuget\nuget.exe restore "$MRTSourcesDirectory\mrt\MrtCore.sln" -ConfigFile NuGet.config - - if ($lastexitcode -ne 0) - { - write-host "ERROR: restore MrtCore.sln FAILED." - exit 1 - } - - & .\.nuget\nuget.exe restore "$MRTSourcesDirectory\mrt\Microsoft.Windows.ApplicationModel.Resources\src\packages.config" -ConfigFile NuGet.config - - if ($lastexitcode -ne 0) - { - write-host "ERROR: restore Microsoft.Windows.ApplicationModel.Resources\src\packages.config FAILED." - exit 1 - } - - & .\.nuget\nuget.exe restore "$MRTSourcesDirectory\mrt\mrm\mrmex\packages.config" -ConfigFile NuGet.config - - if ($lastexitcode -ne 0) - { - write-host "ERROR: restore mrm\mrmex\packages.config FAILED." - exit 1 - } - - & .\.nuget\nuget.exe restore "$MRTSourcesDirectory\mrt\mrm\mrmmin\packages.config" -ConfigFile NuGet.config - - if ($lastexitcode -ne 0) - { - write-host "ERROR: restore mrmmin\packages.config FAILED." - exit 1 - } - - & .\.nuget\nuget.exe restore "$MRTSourcesDirectory\mrt\mrm\unittests\packages.config" -ConfigFile NuGet.config - - if ($lastexitcode -ne 0) - { - write-host "ERROR: restore unittests\packages.config FAILED." - exit 1 - } + NugetRestore "MrtCore" "$MRTSourcesDirectory\mrt\MrtCore.sln" + NugetRestore "Microsoft.Windows.ApplicationModel.Resources" "$MRTSourcesDirectory\mrt\Microsoft.Windows.ApplicationModel.Resources\src\packages.config" + NugetRestore "mrmex" "$MRTSourcesDirectory\mrt\mrm\mrmex\packages.config" + NugetRestore "mrmmin" "$MRTSourcesDirectory\mrt\mrm\mrmmin\packages.config" + NugetRestore "unittests" "$MRTSourcesDirectory\mrt\mrm\unittests\packages.config" # Init mrtcore foreach($platformToRun in $platform.Split(",")) @@ -246,11 +214,11 @@ Try { & $msBuildPath /restore "$MRTSourcesDirectory\mrt\MrtCore.sln" ` /p:Configuration=$configurationToRun,Platform=$platformToRun ` /p:PGOBuildMode=$PGOBuildMode ` - /binaryLogger:"BuildOutput/mrtcore.$platformToRun.$configurationToRun.binlog" + /binaryLogger:"BuildOutput/binlogs/MrtCore.$platformToRun.$configurationToRun.binlog" if ($lastexitcode -ne 0) { - write-host "ERROR: Building '$MRTSourcesDirectory\mrt\MrtCore.sln' FAILED." + write-host "ERROR: msbuild.exe '$MRTSourcesDirectory\mrt\MrtCore.sln' FAILED." exit 1 } } @@ -262,11 +230,11 @@ Try { #------------------ # Build windowsAppRuntime.sln (anyCPU) and move output to staging. #------------------ - # build AnyCPU + # build and restore AnyCPU & $msBuildPath /restore "dev\Bootstrap\CS\Microsoft.WindowsAppRuntime.Bootstrap.Net\Microsoft.WindowsAppRuntime.Bootstrap.Net.csproj" /p:Configuration=$configurationForMrtAndAnyCPU,Platform=AnyCPU if ($lastexitcode -ne 0) { - write-host "ERROR: msbuild restore Microsoft.WindowsAppRuntime.Bootstrap.Net.csproj FAILED." + write-host "ERROR: msbuild.exe Microsoft.WindowsAppRuntime.Bootstrap.Net.csproj FAILED." exit 1 } } @@ -417,12 +385,6 @@ Try { exit 1 } } - # if (($AzureBuildStep -eq "all") -Or ($AzureBuildStep -eq "BuildMock")) - # { - # $transportPackagepath = (Join-Path $OutputDirectory "Microsoft.WindowsAppSDK.Foundation.TransportPackage.$PackageVersion.nupkg") - # . eng\common\Scripts\buildMockWinAppSdkPackage.ps1 -TransportPackageName "Foundation" -TransportPackagePath $transportPackagepath -RepoRoot $env:Build_SourcesDirectory -Output $OutputDirectory -Platform $Platform -Configuration $Configuration -TransportPackageVersion $PackageVersion -CleanOutput - # } - $files = Get-ChildItem $OutputDirectory -File -Filter "*.nupkg" foreach ($file in $files) { diff --git a/Directory.Build.props b/Directory.Build.props index 0ce68daa26..9fb22e5b93 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,9 +1,10 @@ - + + @@ -23,6 +24,7 @@ $(RepoRoot)\WasdkStrongNameSign.snk 10.0.17763.$(CsWinRTDependencyWindowsSdkVersionSuffixPackageVersion) + x64 diff --git a/LkgToolset.props b/LkgToolset.props new file mode 100644 index 0000000000..c0df8fbb20 --- /dev/null +++ b/LkgToolset.props @@ -0,0 +1,23 @@ + + + + + + + true + true + + + + + true + Win32 + $([MSBuild]::GetPathOfFileAbove('custom.props', '$(MSBuildThisFileDirectory)')) + + + + x86 + + + diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage.yml index 40f447015a..02d581f879 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage.yml @@ -26,7 +26,7 @@ stages: targetType: filePath filePath: tools\VerifyCopyrightHeaders.ps1 - - job: BuildBinaries + - job: BuildFoundation pool: ${{ if parameters.IsOneBranch }}: type: windows @@ -63,13 +63,13 @@ stages: ob_sdl_apiscan_softwareFolder: '$(build.SourcesDirectory)\APIScanTarget' ob_sdl_apiscan_symbolsFolder: '$(build.SourcesDirectory)\APIScanTarget;SRV*https://symweb.azurefd.net' steps: - - template: WindowsAppSDK-BuildBinaries-Steps.yml@self + - template: WindowsAppSDK-BuildFoundation-Steps.yml@self parameters: SignOutput: ${{ parameters.SignOutput }} IsOneBranch: ${{ parameters.IsOneBranch }} runStaticAnalysis : ${{ parameters.runStaticAnalysis }} - - job: BuildBinaries_release_anycpu + - job: BuildFoundation_release_anycpu # For now, this job just builds Microsoft.WindowsAppRuntime.Bootstrap.Net.dll in AnyCPU # Can be expanded to add any other binary as needed pool: @@ -90,7 +90,7 @@ stages: ob_sdl_apiscan_softwareFolder: '$(build.SourcesDirectory)\BuildOutput\Release\AnyCPU' ob_sdl_apiscan_symbolsFolder: '$(build.SourcesDirectory)\BuildOutput\Release\AnyCPU;SRV*https://symweb.azurefd.net' steps: - - template: WindowsAppSDK-BuildBinaries-AnyCPU-Steps.yml@self + - template: WindowsAppSDK-BuildFoundation-AnyCPU-Steps.yml@self parameters: SignOutput: ${{ parameters.SignOutput }} IsOneBranch: ${{ parameters.IsOneBranch }} diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-BuildBinaries-AnyCPU-Steps.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-AnyCPU-Steps.yml similarity index 99% rename from build/AzurePipelinesTemplates/WindowsAppSDK-BuildBinaries-AnyCPU-Steps.yml rename to build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-AnyCPU-Steps.yml index 25886ec5b3..174676c0d3 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-BuildBinaries-AnyCPU-Steps.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-AnyCPU-Steps.yml @@ -27,7 +27,7 @@ steps: IsOneBranch: ${{ parameters.IsOneBranch }} - task: PowerShell@2 - name: BuildBinaries + name: BuildFoundation inputs: filePath: 'BuildAll.ps1' arguments: -AzureBuildStep "BuildAnyCPU" diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-BuildBinaries-Steps.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-Steps.yml similarity index 95% rename from build/AzurePipelinesTemplates/WindowsAppSDK-BuildBinaries-Steps.yml rename to build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-Steps.yml index 50e25de929..c587c36a80 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-BuildBinaries-Steps.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-Steps.yml @@ -63,12 +63,15 @@ steps: compilerPackageName: $(compilerOverridePackageName) compilerPackageVersion: $(compilerOverridePackageVersion) slnDirectory: $(Build.SourcesDirectory) + includeUCRT: true + ucrtFeedPat: $(System.AccessToken) + platform: $(buildPlatform) - task: PowerShell@2 - name: BuildBinaries + name: BuildFoundation inputs: filePath: 'BuildAll.ps1' - arguments: -Platform "$(buildPlatform)" -Configuration "$(buildConfiguration)" -AzureBuildStep "BuildBinaries" + arguments: -Platform "$(buildPlatform)" -Configuration "$(buildConfiguration)" -AzureBuildStep "BuildFoundation" - ${{ if eq(parameters.runStaticAnalysis, 'True') }}: - task: SDLNativeRules@3 @@ -130,18 +133,21 @@ steps: # so the CopyFiles below are to move all the vPack files to the right locations - task: CopyFiles@2 displayName: MoveToOutputDirectory + condition: always() inputs: SourceFolder: '$(build.SourcesDirectory)\BuildOutput' TargetFolder: '$(ob_outputDirectory)' - task: CopyFiles@2 displayName: MoveToOutputDirectory + condition: always() inputs: SourceFolder: '$(build.SourcesDirectory)\packages' TargetFolder: '$(ob_outputDirectory)\packages' - ${{ if not( parameters.IsOneBranch ) }}: - task: PublishBuildArtifacts@1 + condition: always() inputs: PathtoPublish: '$(ob_outputDirectory)' artifactName: '$(ob_artifactBaseName)' \ No newline at end of file diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-BuildInstaller-Steps.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-BuildInstaller-Steps.yml index e2e488190d..941f3fdbf9 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-BuildInstaller-Steps.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-BuildInstaller-Steps.yml @@ -202,6 +202,9 @@ steps: compilerPackageName: $(compilerOverridePackageName) compilerPackageVersion: $(compilerOverridePackageVersion) slnDirectory: $(Build.SourcesDirectory)\$(foundationRepoPath)installer\dev + includeUCRT: true + ucrtFeedPat: $(System.AccessToken) + platform: $(buildPlatform) - task: VSBuild@1 displayName: 'Build Windows App Runtime Install' @@ -262,6 +265,7 @@ steps: - ${{ if ne(parameters.IsOneBranch, 'true') }}: - task: PublishBuildArtifacts@1 + condition: always() inputs: PathtoPublish: '$(ob_outputDirectory)' artifactName: '$(ob_artifactBaseName)' diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-BuildMRT-Steps.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-BuildMRT-Steps.yml index 3af5de7524..6299eb9410 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-BuildMRT-Steps.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-BuildMRT-Steps.yml @@ -21,6 +21,9 @@ steps: compilerPackageName: $(compilerOverridePackageName) compilerPackageVersion: $(compilerOverridePackageVersion) slnDirectory: $(Build.SourcesDirectory)\dev\MRTCore\mrt + includeUCRT: true + ucrtFeedPat: $(System.AccessToken) + platform: $(buildPlatform) - task: PowerShell@2 name: BuildBinaries @@ -88,6 +91,7 @@ steps: - ${{ if not( parameters.IsOneBranch ) }}: - task: PublishBuildArtifacts@1 + condition: always() inputs: PathtoPublish: '$(ob_outputDirectory)' artifactName: '$(ob_artifactBaseName)' diff --git a/installer/dev/main.cpp b/installer/dev/main.cpp index 8fe2f4b73f..9e2f79dcba 100644 --- a/installer/dev/main.cpp +++ b/installer/dev/main.cpp @@ -6,6 +6,11 @@ #include "install.h" #include "resource.h" +#ifndef GUID_NULL +struct __declspec(uuid("00000000-0000-0000-0000-000000000000")) GUID_NULL; +#define GUID_NULL __uuidof(struct GUID_NULL) +#endif + using namespace winrt; using namespace WindowsAppRuntimeInstaller::Console;