Update build.ps1

This commit is contained in:
Netch
2021-09-12 23:54:09 +08:00
parent 6885389a52
commit 626686fec6
4 changed files with 16 additions and 6 deletions

View File

@@ -5,13 +5,15 @@ if ( -Not $? ) {
Pop-Location
exit $lastExitCode
}
Push-Location src
$Env:CGO_ENABLED='0'
$Env:GOROOT_FINAL='/usr'
$Env:GOOS='windows'
$Env:GOARCH='amd64'
go build -a -trimpath -asmflags '-s -w' -ldflags '-s -w' -o '..\release\ck-client.exe' '.\src\cmd\ck-client'
go build -a -trimpath -asmflags '-s -w' -ldflags '-s -w' -o '..\..\release\ck-client.exe' '.\cmd\ck-client'
Pop-Location
Pop-Location
exit $lastExitCode

View File

@@ -5,25 +5,29 @@ if ( -Not $? ) {
Pop-Location
exit $lastExitCode
}
Push-Location src
$Env:CGO_ENABLED='0'
$Env:GOROOT_FINAL='/usr'
$Env:GOOS='windows'
$Env:GOARCH='amd64'
go build -a -trimpath -asmflags '-s -w' -ldflags '-s -w -buildid=' -o '..\release\v2ray.exe' '.\src\main'
go build -a -trimpath -asmflags '-s -w' -ldflags '-s -w -buildid=' -o '..\release\v2ray.exe' '.\main'
if ( -Not $? ) {
Pop-Location
Pop-Location
exit $lastExitCode
}
go build -a -trimpath -asmflags '-s -w' -ldflags '-s -w -buildid=' -tags confonly -o '..\release\v2ctl.exe' '.\src\infra\control\main'
go build -a -trimpath -asmflags '-s -w' -ldflags '-s -w -buildid=' -tags confonly -o '..\release\v2ctl.exe' '.\infra\control\main'
if ( -Not $? ) {
Pop-Location
Pop-Location
exit $lastExitCode
}
go build -a -trimpath -asmflags '-s -w' -ldflags '-s -w -buildid= -H windowsgui' -o '..\release\wv2ray.exe' '.\src\main'
go build -a -trimpath -asmflags '-s -w' -ldflags '-s -w -buildid= -H windowsgui' -o '..\release\wv2ray.exe' '.\main'
Pop-Location
Pop-Location
exit $lastExitCode

View File

@@ -5,13 +5,15 @@ if ( -Not $? ) {
Pop-Location
exit $lastExitCode
}
Push-Location src
$Env:CGO_ENABLED='0'
$Env:GOROOT_FINAL='/usr'
$Env:GOOS='windows'
$Env:GOARCH='amd64'
go build -a -trimpath -asmflags '-s -w' -ldflags '-s -w -buildid=' -o '..\release\xray.exe' '.\src\main'
go build -a -trimpath -asmflags '-s -w' -ldflags '-s -w -buildid=' -o '..\..\release\xray.exe' '.\main'
Pop-Location
Pop-Location
exit $lastExitCode

View File

@@ -5,13 +5,15 @@ if ( -Not $? ) {
Pop-Location
exit $lastExitCode
}
Push-Location src
$Env:CGO_ENABLED='0'
$Env:GOROOT_FINAL='/usr'
$Env:GOOS='windows'
$Env:GOARCH='amd64'
go build -a -trimpath -asmflags '-s -w' -ldflags '-s -w' -o '..\release\xray-plugin.exe' '.\src'
go build -a -trimpath -asmflags '-s -w' -ldflags '-s -w' -o '..\..\release\xray-plugin.exe'
Pop-Location
Pop-Location
exit $lastExitCode