forked from PowershellFrameworkCollective/psframework
-
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.
- Loading branch information
1 parent
398c373
commit 9c54367
Showing
1 changed file
with
43 additions
and
0 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,43 @@ | ||
<# | ||
.SYNOPSIS | ||
Builds the PSFramework binary library from source. | ||
.DESCRIPTION | ||
Builds the PSFramework binary library from source. | ||
.PARAMETER WorkingDirectory | ||
Path where the project root is. | ||
Defaults to the parent folder this file is in. | ||
.EXAMPLE | ||
PS C:\> .\vsts-build-library.ps1 | ||
Builds the PSFramework binary library from source. | ||
#> | ||
[CmdletBinding()] | ||
param ( | ||
$WorkingDirectory | ||
) | ||
|
||
#region Handle Working Directory Defaults | ||
if (-not $WorkingDirectory) | ||
{ | ||
if ($env:RELEASE_PRIMARYARTIFACTSOURCEALIAS) | ||
{ | ||
$WorkingDirectory = Join-Path -Path $env:SYSTEM_DEFAULTWORKINGDIRECTORY -ChildPath $env:RELEASE_PRIMARYARTIFACTSOURCEALIAS | ||
} | ||
else { $WorkingDirectory = $env:SYSTEM_DEFAULTWORKINGDIRECTORY } | ||
} | ||
if (-not $WorkingDirectory) { $WorkingDirectory = Split-Path $PSScriptRoot } | ||
#endregion Handle Working Directory Defaults | ||
|
||
# Build Library | ||
dotnet build "$WorkingDirectory\library\PSFramework.sln" | ||
if ($LASTEXITCODE -ne 0) { | ||
throw "Failed to build PSFramework.dll!" | ||
} | ||
|
||
dotnet build -c PS4 "$WorkingDirectory\library\PSFramework.sln" | ||
if ($LASTEXITCODE -ne 0) { | ||
throw "Failed to build PSFramework.dll!" | ||
} |