Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #484 from dotnet/buildOnLinux
Get NB.GV building on Linux
- Loading branch information
Showing
14 changed files
with
310 additions
and
15 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#------------------------------------------------------------------------------ | ||
# This file contains command-line options that MSBuild will process as part of | ||
# every build, unless the "/noautoresponse" switch is specified. | ||
# | ||
# MSBuild processes the options in this file first, before processing the | ||
# options on the command line. As a result, options on the command line can | ||
# override the options in this file. However, depending on the options being | ||
# set, the overriding can also result in conflicts. | ||
# | ||
# NOTE: The "/noautoresponse" switch cannot be specified in this file, nor in | ||
# any response file that is referenced by this file. | ||
#------------------------------------------------------------------------------ | ||
/nr:false | ||
/m | ||
/verbosity:minimal | ||
/clp:Summary;ForceNoAlign |
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
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,79 @@ | ||
<# | ||
.SYNOPSIS | ||
Set environment variables in the environment. | ||
Azure Pipeline and CMD environments are considered. | ||
.PARAMETER Variables | ||
A hashtable of variables to be set. | ||
.OUTPUTS | ||
A boolean indicating whether the environment variables can be expected to propagate to the caller's environment. | ||
#> | ||
[CmdletBinding(SupportsShouldProcess=$true)] | ||
Param( | ||
[Parameter(Mandatory=$true, Position=1)] | ||
$Variables, | ||
[string[]]$PrependPath | ||
) | ||
|
||
if ($Variables.Count -eq 0) { | ||
return $true | ||
} | ||
|
||
$cmdInstructions = !$env:TF_BUILD -and !$env:GITHUB_ACTIONS -and $env:PS1UnderCmd -eq '1' | ||
if ($cmdInstructions) { | ||
Write-Warning "Environment variables have been set that will be lost because you're running under cmd.exe" | ||
Write-Host "Environment variables that must be set manually:" -ForegroundColor Blue | ||
} else { | ||
Write-Host "Environment variables set:" -ForegroundColor Blue | ||
Write-Host ($Variables | Out-String) | ||
if ($PrependPath) { | ||
Write-Host "Paths prepended to PATH: $PrependPath" | ||
} | ||
} | ||
|
||
if ($env:TF_BUILD) { | ||
Write-Host "Azure Pipelines detected. Logging commands will be used to propagate environment variables and prepend path." | ||
} | ||
|
||
if ($env:GITHUB_ACTIONS) { | ||
Write-Host "GitHub Actions detected. Logging commands will be used to propagate environment variables and prepend path." | ||
} | ||
|
||
$Variables.GetEnumerator() |% { | ||
Set-Item -Path env:$($_.Key) -Value $_.Value | ||
|
||
# If we're running in a cloud CI, set these environment variables so they propagate. | ||
if ($env:TF_BUILD) { | ||
Write-Host "##vso[task.setvariable variable=$($_.Key);]$($_.Value)" | ||
} | ||
if ($env:GITHUB_ACTIONS) { | ||
Write-Host "::set-env name=$($_.Key)::$($_.Value)" | ||
} | ||
|
||
if ($cmdInstructions) { | ||
Write-Host "SET $($_.Key)=$($_.Value)" | ||
} | ||
} | ||
|
||
$pathDelimiter = ';' | ||
if ($IsMacOS -or $IsLinux) { | ||
$pathDelimiter = ':' | ||
} | ||
|
||
if ($PrependPath) { | ||
$PrependPath |% { | ||
$newPathValue = "$_$pathDelimiter$env:PATH" | ||
Set-Item -Path env:PATH -Value $newPathValue | ||
if ($cmdInstructions) { | ||
Write-Host "SET PATH=$newPathValue" | ||
} | ||
|
||
if ($env:TF_BUILD) { | ||
Write-Host "##vso[task.prependpath]$_" | ||
} | ||
if ($env:GITHUB_ACTIONS) { | ||
Write-Host "::add-path::$_" | ||
} | ||
} | ||
} | ||
|
||
return !$cmdInstructions |
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,2 @@ | ||
$globalJson = Get-Content -Path "$PSScriptRoot\..\..\global.json" | ConvertFrom-Json | ||
$globalJson.sdk.version |
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 |
---|---|---|
@@ -1 +1,4 @@ | ||
powershell.exe -ExecutionPolicy bypass -NoProfile -Command "& '%~dpn0.ps1'" %* | ||
@echo off | ||
SETLOCAL | ||
set PS1UnderCmd=1 | ||
powershell.exe -NoProfile -NoLogo -ExecutionPolicy bypass -Command "try { & '%~dpn0.ps1' %*; exit $LASTEXITCODE } catch { write-host $_; exit 1 }" |
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
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
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
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
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
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
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
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
Oops, something went wrong.