-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert projects to .NET Standard/Core
- Loading branch information
Showing
70 changed files
with
1,105 additions
and
599 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
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,50 @@ | ||
param ( | ||
[string]$WorkingDirectory = "$(Get-Location)", | ||
[string]$OutputPath, | ||
[string]$Verbosity = 'minimal', | ||
[string]$AssemblyName | ||
) | ||
|
||
# Expand environment variables | ||
$WorkingDirectory = ([System.Environment]::ExpandEnvironmentVariables($WorkingDirectory)) | ||
$OutputPath = ([System.Environment]::ExpandEnvironmentVariables($OutputPath)) | ||
|
||
# Make sure the dotnet command is installed | ||
$dotnetCliVersion = Invoke-Expression 'dotnet --version' | ||
|
||
# If dotnet is not installed, attempt to install it | ||
if ($dotnetCliVersion.Contains('\n') -or [string]::IsNullOrWhitespace($dotnetCliVersion)) { | ||
& $env:dotnetInstallScript | ||
} | ||
|
||
# Compile the MSBuild arguments | ||
$BuildArguments = @( | ||
"--configuration $($env:buildConfiguration)", | ||
"--verbosity $Verbosity" | ||
) | ||
|
||
# Set the output path if required | ||
if (-Not [string]::IsNullOrWhiteSpace($OutputPath)) | ||
{ | ||
$MSBuildArguments += "--output `"$OutputPath`"" | ||
} | ||
|
||
# Set the assembly name if required | ||
if (-Not [string]::IsNullOrWhiteSpace($AssemblyName)) | ||
{ | ||
$BuildArguments += "/p:AssemblyName=$AssemblyName" | ||
} | ||
|
||
# Run MSBuild in the given working directory | ||
Push-Location $WorkingDirectory | ||
try { | ||
$command = "dotnet build $BuildArguments" | ||
Write-Host $command -f DarkCyan | ||
Invoke-Expression $command | ||
if (-Not $?) | ||
{ | ||
throw "MSBuild exited with error code '$LastExitCode'" | ||
} | ||
} finally { | ||
Pop-Location | ||
} |
Oops, something went wrong.