Skip to content

Commit

Permalink
Create vsts-build-library.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
FriedrichWeinmann committed May 20, 2024
1 parent 398c373 commit 9c54367
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions build/vsts-build-library.ps1
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!"
}

0 comments on commit 9c54367

Please sign in to comment.