This repository has been archived by the owner on May 3, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild.ps1
38 lines (31 loc) · 1.38 KB
/
build.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
Param(
[Parameter(Position = 0)]
[Boolean]$IsBuildAgent = $false,
[Parameter(Position = 1)]
[String]$Configuration = "Release",
[Parameter(Position = 2)]
[String]$VersionSuffix = ""
)
if((-Not ($IsBuildAgent)) -And ([string]::IsNullOrEmpty($VersionSuffix))) {
$VersionSuffix = "1"
}
$VersionSuffixCommand = ""
if(-Not ([string]::IsNullOrEmpty($VersionSuffix))) {
$VersionSuffixCommand = "--version-suffix"
}
Write-Information -MessageData "Restoring 'MSFSTouchPortalPlugin' component....`n" -InformationAction Continue
dotnet restore "MSFSTouchPortalPlugin"
dotnet restore "MSFSTouchPortalPlugin.Tests"
Write-Information -MessageData "Building 'MSFSTouchPortalPlugin' component...`n" -InformationAction Continue
dotnet build "MSFSTouchPortalPlugin" --configuration $Configuration
Write-Information "Cleaning 'MSFSTouchPortalPlugin' packages-dist folder..." -InformationAction Continue
$CurrentDir = [System.IO.Path]::GetDirectoryName($myInvocation.MyCommand.Path)
$DistFolderPath = "$CurrentDir\packages-dist"
if (Test-Path $DistFolderPath) {
Remove-Item $DistFolderPath -Force -Recurse
}
Write-Information "Publishing 'MSFSTouchPortalPlugin' component...`n" -InformationAction Continue
dotnet publish "MSFSTouchPortalPlugin" --output $DistFolderPath --configuration $Configuration $VersionSuffixCommand $VersionSuffix -r "win-x64" --self-contained true
if ($IsBuildAgent) {
exit 0
}