forked from MessagePack-CSharp/MessagePack-CSharp
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes MessagePack-CSharp#1244
- Loading branch information
Showing
13 changed files
with
248 additions
and
61 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,20 @@ | ||
@echo off | ||
SETLOCAL | ||
set PS1UnderCmd=1 | ||
|
||
:: Get the datetime in a format that can go in a filename. | ||
set _my_datetime=%date%_%time% | ||
set _my_datetime=%_my_datetime: =_% | ||
set _my_datetime=%_my_datetime::=% | ||
set _my_datetime=%_my_datetime:/=_% | ||
set _my_datetime=%_my_datetime:.=_% | ||
set CmdEnvScriptPath=%temp%\envvarscript_%_my_datetime%.cmd | ||
|
||
powershell.exe -NoProfile -NoLogo -ExecutionPolicy bypass -Command "try { & '%~dpn0.ps1' %*; exit $LASTEXITCODE } catch { write-host $_; exit 1 }" | ||
|
||
:: Set environment variables in the parent cmd.exe process. | ||
IF EXIST "%CmdEnvScriptPath%" ( | ||
ENDLOCAL | ||
CALL "%CmdEnvScriptPath%" | ||
DEL "%CmdEnvScriptPath%" | ||
) |
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,41 @@ | ||
<# | ||
.SYNOPSIS | ||
Checks whether a given .NET Core runtime is installed. | ||
#> | ||
[CmdletBinding()] | ||
Param ( | ||
[Parameter()] | ||
[ValidateSet('Microsoft.AspNetCore.App','Microsoft.NETCore.App')] | ||
[string]$Runtime='Microsoft.NETCore.App', | ||
[Parameter(Mandatory=$true)] | ||
[Version]$Version | ||
) | ||
|
||
$dotnet = Get-Command dotnet -ErrorAction SilentlyContinue | ||
if (!$dotnet) { | ||
# Nothing is installed. | ||
Write-Output $false | ||
exit 1 | ||
} | ||
|
||
Function IsVersionMatch { | ||
Param( | ||
[Parameter()] | ||
$actualVersion | ||
) | ||
return $actualVersion -and | ||
$Version.Major -eq $actualVersion.Major -and | ||
$Version.Minor -eq $actualVersion.Minor -and | ||
(($Version.Build -eq -1) -or ($Version.Build -eq $actualVersion.Build)) -and | ||
(($Version.Revision -eq -1) -or ($Version.Revision -eq $actualVersion.Revision)) | ||
} | ||
|
||
$installedRuntimes = dotnet --list-runtimes |? { $_.Split()[0] -ieq $Runtime } |% { $v = $null; [Version]::tryparse($_.Split()[1], [ref] $v); $v } | ||
$matchingRuntimes = $installedRuntimes |? { IsVersionMatch -actualVersion $_ } | ||
if (!$matchingRuntimes) { | ||
Write-Output $false | ||
exit 1 | ||
} | ||
|
||
Write-Output $true | ||
exit 0 |
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,37 @@ | ||
<# | ||
.SYNOPSIS | ||
Checks whether the .NET Core SDK required by this repo is installed. | ||
#> | ||
[CmdletBinding()] | ||
Param ( | ||
) | ||
|
||
$dotnet = Get-Command dotnet -ErrorAction SilentlyContinue | ||
if (!$dotnet) { | ||
# Nothing is installed. | ||
Write-Output $false | ||
exit 1 | ||
} | ||
|
||
# We need to set the current directory so dotnet considers the SDK required by our global.json file. | ||
Push-Location "$PSScriptRoot\.." | ||
try { | ||
dotnet -h 2>&1 | Out-Null | ||
if (($LASTEXITCODE -eq 129) -or # On Linux | ||
($LASTEXITCODE -eq -2147450751) # On Windows | ||
) { | ||
# These exit codes indicate no matching SDK exists. | ||
Write-Output $false | ||
exit 2 | ||
} | ||
|
||
# The required SDK is already installed! | ||
Write-Output $true | ||
exit 0 | ||
} catch { | ||
# I don't know why, but on some build agents (e.g. MicroBuild), an exception is thrown from the `dotnet` invocation when a match is not found. | ||
Write-Output $false | ||
exit 3 | ||
} finally { | ||
Pop-Location | ||
} |
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.