-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.ps1
44 lines (35 loc) · 1.03 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
39
40
41
42
43
44
$ErrorActionPreference = "Stop"
Set-Location "$PSScriptRoot"
New-Item "tmp", "dist" -ItemType Directory -Force | Out-Null
function build($plartform) {
Set-Location src\
msbuild.exe /p:Configuration="Release;Platform=$plartform" /m
if ($LASTEXITCODE -ne 0) { throw "Build failed." }
Set-Location ..\
$ebridge = "src\$plartform\Release\ebridge.exe"
$version = (Get-Content src\version.h) -replace '^.*?"|".*?$',""
$name="eopen-ecd-$version-$plartform"
Remove-Item "tmp\$name" -Recurse -ErrorAction Ignore
New-Item "tmp\$name", "tmp\$name\bin" -ItemType Directory | Out-Null
$files = @(
"README.md"
"CHANGELOG.md"
"LICENSE"
"init.bat"
"init.ps1"
"init.sh"
"cmd"
"cygwin"
"pwsh"
"share"
"wsl"
)
Copy-Item -Path $files -Recurse -Destination "tmp\$name"
Copy-Item -Path "$ebridge" -Destination "tmp\$name\bin"
Compress-Archive -Path "tmp\$name" -DestinationPath "dist\$name.zip" -Force
}
foreach($plartform in $args){
build $plartform
}
Get-ChildItem dist
Write-Output "Generated"