-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathbuild.ps1
32 lines (27 loc) · 1.22 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
# This is the script to build and zip the executables
# from the solutions.
# Include settings and common functions
$scriptRoot = $($MyInvocation.MyCommand.Definition) | Split-Path
. "$scriptRoot/tools/config.ps1"
. "$scriptRoot/tools/common.ps1"
# Clean output first
if (Test-Path -Path $solution.targetFolder) {
Remove-Item $solution.targetFolder -Recurse
}
if (Test-Path -Path $solution.assetZipPath) {
Remove-Item $solution.assetZipPath
}
# Build all dotnet projects into $solution.targetFolder as single exe's. Skip Test projects.
foreach ($sln in (Get-ChildItem -Recurse src\*\*.csproj -Exclude *.Test.*)) {
Write-Host "Building $($sln.FullName)"
& dotnet publish $sln.FullName -c Release -r win-x64 /p:PublishSingleFile=true /p:CopyOutputSymbolsToPublishDirectory=false --self-contained false -o $solution.targetFolder
Write-Host "Packing $($sln.FullName)"
& dotnet pack $sln.FullName -c Release -p:PackAsTool=true -o ./artifacts
}
Get-ChildItem ./artifacts
# remove possible generated XML documentation files
Remove-Item "$($solution.targetFolder)\*.xml"
# Copy license to the folder to package
Copy-Item LICENSE $solution.targetFolder
# Zip targetFolder
PackAssetZip $solution.targetFolder $solution.assetZipPath