Skip to content

Commit 227009e

Browse files
Merge pull request #2429 from microsoft/staging
Release - 3/18/24
2 parents bff3409 + ad5c00d commit 227009e

File tree

771 files changed

+27828
-1909
lines changed

Some content is hidden

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

771 files changed

+27828
-1909
lines changed

.github/workflows/DevHome-CI.yml

+18
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,24 @@ jobs:
6464
- name: Build_SDK
6565
run: cmd /c "$env:VSDevCmd" "&" msbuild /p:Configuration=Release,Platform=${{ matrix.platform }} extensionsdk\\DevHomeSDK.sln
6666

67+
- name: Build_DevSetupAgent_x86
68+
if: ${{ matrix.platform != 'arm64' }}
69+
run: cmd /c "$env:VSDevCmd" "&" msbuild /p:Configuration=${{ matrix.configuration }},Platform=x86 HyperVExtension\\DevSetupAgent.sln
70+
71+
- name: Compress_DevSetupAgent_x86
72+
if: ${{ matrix.platform != 'arm64' }}
73+
shell: pwsh
74+
run: Compress-Archive -Force -Path HyperVExtension\src\DevSetupAgent\bin\x86\${{ matrix.configuration }}\net8.0-windows10.0.22000.0\win10-x86\* -DestinationPath "HyperVExtension\src\DevSetupAgent\bin\x86\${{ matrix.configuration }}\DevSetupAgent_x86.zip"
75+
76+
- name: Build_DevSetupAgent_arm64
77+
if: ${{ matrix.platform == 'arm64' }}
78+
run: cmd /c "$env:VSDevCmd" "&" msbuild /p:Configuration=${{ matrix.configuration }},Platform=arm64 HyperVExtension\\DevSetupAgent.sln
79+
80+
- name: Compress_DevSetupAgent_arm64
81+
if: ${{ matrix.platform == 'arm64' }}
82+
shell: pwsh
83+
run: Compress-Archive -Force -Path HyperVExtension\src\DevSetupAgent\bin\arm64\${{ matrix.configuration }}\net8.0-windows10.0.22000.0\win10-arm64\* -DestinationPath "HyperVExtension\src\DevSetupAgent\bin\arm64\${{ matrix.configuration }}\DevSetupAgent_arm64.zip"
84+
6785
- name: Build_DevHome
6886
run: cmd /c "$env:VSDevCmd" "&" msbuild /p:Configuration=${{ matrix.configuration }},Platform=${{ matrix.platform }} DevHome.sln
6987

Build.ps1

+21-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Description:
2626
Options:
2727
2828
-Platform <platform>
29-
Only buil the selected platform(s)
29+
Only build the selected platform(s)
3030
Example: -Platform x64
3131
Example: -Platform "x86,x64,arm64"
3232
@@ -61,6 +61,22 @@ if (($BuildStep -ieq "all") -Or ($BuildStep -ieq "sdk")) {
6161
}
6262
}
6363

64+
if (($BuildStep -ieq "all") -Or ($BuildStep -ieq "DevSetupAgent") -Or ($BuildStep -ieq "fullMsix")) {
65+
foreach ($configuration in $env:Build_Configuration.Split(",")) {
66+
# We use x86 DevSetupAgent for x64 and x86 Dev Home build. Only need to build it once if we are building multiple platforms.
67+
$builtX86 = $false
68+
foreach ($platform in $env:Build_Platform.Split(",")) {
69+
if ($Platform -ieq "arm64") {
70+
HyperVExtension\BuildDevSetupAgentHelper.ps1 -Platform $Platform -Configuration $configuration -VersionOfSDK $env:sdk_version -SDKNugetSource $SDKNugetSource -AzureBuildingBranch $AzureBuildingBranch -IsAzurePipelineBuild $IsAzurePipelineBuild -BypassWarning
71+
}
72+
elseif (-not $builtX86) {
73+
HyperVExtension\BuildDevSetupAgentHelper.ps1 -Platform "x86" -Configuration $configuration -VersionOfSDK $env:sdk_version -SDKNugetSource $SDKNugetSource -AzureBuildingBranch $AzureBuildingBranch -IsAzurePipelineBuild $IsAzurePipelineBuild -BypassWarning
74+
$builtX86 = $true
75+
}
76+
}
77+
}
78+
}
79+
6480
$msbuildPath = &"${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -prerelease -products * -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe
6581
if ($IsAzurePipelineBuild) {
6682
$nugetPath = "nuget.exe";
@@ -79,7 +95,7 @@ if (-not([string]::IsNullOrWhiteSpace($SDKNugetSource))) {
7995
. build\Scripts\CertSignAndInstall.ps1
8096

8197
Try {
82-
if (($BuildStep -ieq "all") -Or ($BuildStep -ieq "msix")) {
98+
if (($BuildStep -ieq "all") -Or ($BuildStep -ieq "msix") -Or ($BuildStep -ieq "fullMsix")) {
8399
$buildRing = "Dev"
84100
$newPackageName = $null
85101
$newPackageDisplayName = $null
@@ -140,6 +156,9 @@ Try {
140156
}
141157
$appxmanifest.Save($appxmanifestPath)
142158

159+
# This is needed for vcxproj
160+
& $nugetPath restore
161+
143162
foreach ($platform in $env:Build_Platform.Split(",")) {
144163
foreach ($configuration in $env:Build_Configuration.Split(",")) {
145164
$appxPackageDir = (Join-Path $env:Build_RootDirectory "AppxPackages\$configuration")
Binary file not shown.

DevHome.sln

+290-5
Large diffs are not rendered by default.

Directory.Build.props

+4-3
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@
3333
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.556">
3434
<PrivateAssets>all</PrivateAssets>
3535
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
36-
</PackageReference>
37-
<Compile Include="$(MSBuildThisFileDirectory)\codeAnalysis\GlobalSuppressions.cs" Link="GlobalSuppressions.cs" />
36+
</PackageReference>
37+
<Compile Condition="$(MSBuildProjectName) != 'DevHomeStub'" Include="$(MSBuildThisFileDirectory)\codeAnalysis\GlobalSuppressions.cs" Link="GlobalSuppressions.cs" />
38+
<Compile Condition="$(MSBuildProjectName) == 'DevHomeStub'" Include="$(MSBuildThisFileDirectory)\codeAnalysis\StubSuppressions.cs" Link="GlobalSuppressions.cs" />
3839
<AdditionalFiles Include="$(MSBuildThisFileDirectory)\codeAnalysis\StyleCop.json" Link="StyleCop.json" />
3940
</ItemGroup>
4041
<!-- Needed for reverting back to pre-.NET 8 method of Host using the RID graph to determine assets -->
@@ -43,6 +44,6 @@
4344
<UseRidGraph>true</UseRidGraph>
4445
</PropertyGroup>
4546
<ItemGroup>
46-
<RuntimeHostConfigurationOption Include="System.Runtime.Loader.UseRidGraph" Value="true" />
47+
<RuntimeHostConfigurationOption Include="System.Runtime.Loader.UseRidGraph" Value="true" />
4748
</ItemGroup>
4849
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@echo off
2+
3+
powershell -ExecutionPolicy Unrestricted -NoLogo -NoProfile -File %~dp0\BuildDevSetupAgentHelper.ps1 %*
4+
5+
exit /b %ERRORLEVEL%
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
Param(
2+
[string]$Platform = "x64",
3+
[string]$Configuration = "debug",
4+
[string]$VersionOfSDK,
5+
[string]$SDKNugetSource,
6+
[string]$Version,
7+
[string]$BuildStep = "all",
8+
[string]$AzureBuildingBranch = "main",
9+
[bool]$IsAzurePipelineBuild = $false,
10+
[switch]$BypassWarning = $false,
11+
[switch]$Help = $false
12+
)
13+
14+
$StartTime = Get-Date
15+
16+
if ($Help) {
17+
Write-Host @"
18+
Copyright (c) Microsoft Corporation.
19+
Licensed under the MIT License.
20+
21+
Syntax:
22+
BuildDevSetupAgentHelper.cmd [options]
23+
24+
Description:
25+
Builds DevSetupAgent.
26+
27+
Options:
28+
29+
-Platform <platform>
30+
Only build the selected platform(s)
31+
Example: -Platform x64
32+
Example: -Platform "x86,x64,arm64"
33+
34+
-Configuration <configuration>
35+
Only build the selected configuration(s)
36+
Example: -Configuration Release
37+
Example: -Configuration "Debug,Release"
38+
39+
-Help
40+
Display this usage message.
41+
"@
42+
Exit
43+
}
44+
45+
if (-not $BypassWarning) {
46+
Write-Host @"
47+
This script is not meant to be run directly. To build DevSetupAgent, please run the following from the root directory:
48+
build -BuildStep "DevSetupAgent"
49+
"@ -ForegroundColor RED
50+
Exit
51+
}
52+
53+
$isAdmin = ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] 'Administrator')
54+
55+
$ErrorActionPreference = "Stop"
56+
57+
$msbuildPath = &"${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -prerelease -products * -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe
58+
if ($IsAzurePipelineBuild) {
59+
$nugetPath = "nuget.exe";
60+
} else {
61+
$nugetPath = (Join-Path $env:Build_RootDirectory "build\NugetWrapper.cmd")
62+
}
63+
64+
if (-not([string]::IsNullOrWhiteSpace($SDKNugetSource))) {
65+
& $nugetPath sources add -Source $SDKNugetSource
66+
}
67+
68+
Try {
69+
$buildRing = "Dev"
70+
71+
if ($AzureBuildingBranch -ieq "release") {
72+
$buildRing = "Stable"
73+
} elseif ($AzureBuildingBranch -ieq "staging") {
74+
$buildRing = "Canary"
75+
}
76+
77+
Write-Host $nugetPath
78+
79+
& $nugetPath restore
80+
81+
$msbuildArgs = @(
82+
("HyperVExtension\DevSetupAgent.sln"),
83+
("/p:Platform="+$platform),
84+
("/p:Configuration="+$configuration),
85+
("/restore"),
86+
("/binaryLogger:DevSetupAgent.$platform.$configuration.binlog"),
87+
("/p:BuildRing=$buildRing")
88+
)
89+
if (-not([string]::IsNullOrWhiteSpace($VersionOfSDK))) {
90+
$msbuildArgs += ("/p:DevHomeSDKVersion="+$env:sdk_version)
91+
}
92+
93+
& $msbuildPath $msbuildArgs
94+
95+
$binariesOutputPath = (Join-Path $env:Build_RootDirectory "HyperVExtension\src\DevSetupAgent\bin\$Platform\$Configuration\net8.0-windows10.0.22000.0\win10-$Platform\*")
96+
$zipOutputPath = (Join-Path $env:Build_RootDirectory "HyperVExtension\src\DevSetupAgent\bin\$Platform\$Configuration\DevSetupAgent_$Platform.zip")
97+
98+
Compress-Archive -Force -Path $binariesOutputPath $zipOutputPath
99+
} Catch {
100+
$formatString = "`n{0}`n`n{1}`n`n"
101+
$fields = $_, $_.ScriptStackTrace
102+
Write-Host ($formatString -f $fields) -ForegroundColor RED
103+
Exit 1
104+
}
105+
106+
$TotalTime = (Get-Date)-$StartTime
107+
$TotalMinutes = [math]::Floor($TotalTime.TotalMinutes)
108+
$TotalSeconds = [math]::Ceiling($TotalTime.TotalSeconds)
109+
110+
Write-Host @"
111+
Total Running Time:
112+
$TotalMinutes minutes and $TotalSeconds seconds
113+
"@ -ForegroundColor CYAN

0 commit comments

Comments
 (0)