-
Notifications
You must be signed in to change notification settings - Fork 323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Dev Environments feature into main from feature branch #2346
Merged
Merged
Changes from 23 commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
970a573
add initial SDK changes (#2209)
bbonaby 482d529
Merge branch 'main' into microsoftfeature/dev-environments
bbonaby 36dd23d
Add UX code from private ADO branch to public feature branch (#2241)
bbonaby 2e9c120
Move Hyper-V extension code from private repository to public dev env…
bbonaby ca94296
Merge branch 'main' into microsoftfeature/dev-environments
bbonaby eec8889
Initial implementation of IComputeSystem::ApplyConfiguration for Hype…
sshilov7 2f4186a
Add environments to experimentation (#2260)
bbonaby cef8480
Add PowerShell script and a helper class to deploy DevSetupAgent serv…
sshilov7 caa2a92
Hyper-V extension: Add "Ask for VM credentials" and "Wait for logon" …
sshilov7 1c4127c
Changes to make DevSetupEngine work with .NET 8 (#2308)
sshilov7 4eed026
Merge branch 'main' into microsoftfeature/dev-environments
bbonaby 8353204
Build DevSetupAgent separately from the main Dev Home solution and ad…
sshilov7 d0634aa
Merge branch 'microsoftfeature/dev-environments' of https://github.co…
bbonaby c4c71cf
Update setup target flow to allow for configuration of a dev environm…
bbonaby 1bb1d15
update dev environments feature branch with latest idl changes (#2334)
bbonaby 031c4d2
Update environments page UX (#2320)
bbonaby 075af1f
Update build scripts to build DevSetupAgent in Azure official build. …
sshilov7 4ec9e02
Merge branch 'main' into microsoftfeature/dev-environments
bbonaby 532e26a
Merge branch 'main' into microsoftfeature/dev-environments
bbonaby 5ad9d74
update dev home to use new SDK version and other projects to use win …
bbonaby a72e7ea
Fix PS DevSetupAgent deployment script. (#2345)
sshilov7 3271804
Merge branch 'main' into microsoftfeature/dev-environments
bbonaby 60a9139
remove classes that don't need to be added
bbonaby e0c0a00
Change all tabs to spaces
krschau 94d116b
Update tools directory to use crlf
krschau 79baa9d
Update HyperVExtension directory to use crlf
krschau 7d8c2ee
Update common/Environments directory to use crlf
krschau 15af544
Update more in common directory to use crlf
krschau 0c11642
[Hyper-V extension]: Fixes for DevSetupEngine registration, Configure…
sshilov7 b2bb209
remove s that was added from a previous commit causing build to fail
bbonaby 433ebe9
fix tests for build
bbonaby fe542ed
update malformed configuration string to allow arm64 to build
bbonaby File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@echo off | ||
|
||
powershell -ExecutionPolicy Unrestricted -NoLogo -NoProfile -File %~dp0\BuildDevSetupAgentHelper.ps1 %* | ||
|
||
exit /b %ERRORLEVEL% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
Param( | ||
[string]$Platform = "x64", | ||
[string]$Configuration = "debug", | ||
[string]$VersionOfSDK, | ||
[string]$SDKNugetSource, | ||
[string]$Version, | ||
[string]$BuildStep = "all", | ||
[string]$AzureBuildingBranch = "main", | ||
[switch]$IsAzurePipelineBuild = $false, | ||
[switch]$BypassWarning = $false, | ||
[switch]$Help = $false | ||
) | ||
|
||
$StartTime = Get-Date | ||
|
||
if ($Help) { | ||
Write-Host @" | ||
Copyright (c) Microsoft Corporation. | ||
Licensed under the MIT License. | ||
|
||
Syntax: | ||
BuildDevSetupAgentHelper.cmd [options] | ||
|
||
Description: | ||
Builds DevSetupAgent. | ||
|
||
Options: | ||
|
||
-Platform <platform> | ||
Only build the selected platform(s) | ||
Example: -Platform x64 | ||
Example: -Platform "x86,x64,arm64" | ||
|
||
-Configuration <configuration> | ||
Only build the selected configuration(s) | ||
Example: -Configuration Release | ||
Example: -Configuration "Debug,Release" | ||
|
||
-Help | ||
Display this usage message. | ||
"@ | ||
Exit | ||
} | ||
|
||
if (-not $BypassWarning) { | ||
Write-Host @" | ||
This script is not meant to be run directly. To build DevSetupAgent, please run the following from the root directory: | ||
build -BuildStep "DevSetupAgent" | ||
"@ -ForegroundColor RED | ||
Exit | ||
} | ||
|
||
$isAdmin = ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] 'Administrator') | ||
|
||
$ErrorActionPreference = "Stop" | ||
|
||
$msbuildPath = &"${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -prerelease -products * -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe | ||
if ($IsAzurePipelineBuild) { | ||
$nugetPath = "nuget.exe"; | ||
} else { | ||
$nugetPath = (Join-Path $env:Build_RootDirectory "build\NugetWrapper.cmd") | ||
} | ||
|
||
if (-not([string]::IsNullOrWhiteSpace($SDKNugetSource))) { | ||
& $nugetPath sources add -Source $SDKNugetSource | ||
} | ||
|
||
Try { | ||
$buildRing = "Dev" | ||
|
||
if ($AzureBuildingBranch -ieq "release") { | ||
$buildRing = "Stable" | ||
} elseif ($AzureBuildingBranch -ieq "staging") { | ||
$buildRing = "Canary" | ||
} | ||
|
||
$msbuildArgs = @( | ||
("HyperVExtension\DevSetupAgent.sln"), | ||
("/p:Platform="+$platform), | ||
("/p:Configuration="+$configuration), | ||
("/restore"), | ||
("/binaryLogger:DevSetupAgent.$platform.$configuration.binlog"), | ||
("/p:BuildRing=$buildRing") | ||
) | ||
if (-not([string]::IsNullOrWhiteSpace($VersionOfSDK))) { | ||
$msbuildArgs += ("/p:DevHomeSDKVersion="+$env:sdk_version) | ||
} | ||
|
||
& $msbuildPath $msbuildArgs | ||
|
||
$binariesOutputPath = (Join-Path $env:Build_RootDirectory "HyperVExtension\src\DevSetupAgent\bin\$Platform\$Configuration\net8.0-windows10.0.22000.0\win10-$Platform\*") | ||
$zipOutputPath = (Join-Path $env:Build_RootDirectory "HyperVExtension\src\DevSetupAgent\bin\DevSetupAgent_$Platform.zip") | ||
|
||
Compress-Archive -Force -Path $binariesOutputPath $zipOutputPath | ||
} Catch { | ||
$formatString = "`n{0}`n`n{1}`n`n" | ||
$fields = $_, $_.ScriptStackTrace | ||
Write-Host ($formatString -f $fields) -ForegroundColor RED | ||
Exit 1 | ||
} | ||
|
||
$TotalTime = (Get-Date)-$StartTime | ||
$TotalMinutes = [math]::Floor($TotalTime.TotalMinutes) | ||
$TotalSeconds = [math]::Ceiling($TotalTime.TotalSeconds) | ||
|
||
Write-Host @" | ||
Total Running Time: | ||
$TotalMinutes minutes and $TotalSeconds seconds | ||
"@ -ForegroundColor CYAN |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As an FYI (I looked this up recently) powershell scripts conventionally have 4 space indents (not blocking)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Number of spaces per intent is a religion, we just need to agree what we believe in 😄. The existing Build.ps1 and BuildSDKHelper.ps1 have 2 space intents. This script follows what we already have.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We updated Build.ps1 recently to have 4, but I understand we're quite inconsistent now. This was more of a "we came to a conclusion that we'll try to follow going forward" note. (Not that everyone's happy with that conclusion 😄 )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's 4 now, then this one can be changed. I have no problem with any reasonable number (I worked for a company where it was 3).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3 is simply ridiculous :) I'm the one that doesn't like 4 spaces, but I concede it's become the standard.