From 6885389a52623bebbbd888764cc35f0d44bcaea5 Mon Sep 17 00:00:00 2001 From: Netch Date: Sun, 12 Sep 2021 23:51:21 +0800 Subject: [PATCH] Build xray-core --- Other/xray-core/build.ps1 | 17 +++++++++++++++++ Other/xray-core/deps.ps1 | 0 scripts/deps/v2ray-core.ps1 | 24 ------------------------ scripts/deps/xray-core.ps1 | 22 ---------------------- 4 files changed, 17 insertions(+), 46 deletions(-) create mode 100644 Other/xray-core/build.ps1 create mode 100644 Other/xray-core/deps.ps1 delete mode 100644 scripts/deps/v2ray-core.ps1 delete mode 100644 scripts/deps/xray-core.ps1 diff --git a/Other/xray-core/build.ps1 b/Other/xray-core/build.ps1 new file mode 100644 index 00000000..1520ecff --- /dev/null +++ b/Other/xray-core/build.ps1 @@ -0,0 +1,17 @@ +Push-Location (Split-Path $MyInvocation.MyCommand.Path -Parent) + +git clone https://github.com/xtls/xray-core -b 'v1.4.3' src +if ( -Not $? ) { + Pop-Location + exit $lastExitCode +} + +$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' + +Pop-Location +exit $lastExitCode \ No newline at end of file diff --git a/Other/xray-core/deps.ps1 b/Other/xray-core/deps.ps1 new file mode 100644 index 00000000..e69de29b diff --git a/scripts/deps/v2ray-core.ps1 b/scripts/deps/v2ray-core.ps1 deleted file mode 100644 index 057bc9e5..00000000 --- a/scripts/deps/v2ray-core.ps1 +++ /dev/null @@ -1,24 +0,0 @@ -param ( - [string] - $OutputPath -) - -try { - Invoke-WebRequest ` - -Uri 'https://github.com/v2fly/v2ray-core/releases/download/v4.41.1/v2ray-windows-64.zip' ` - -OutFile 'v2ray-core.zip' -} -catch { - exit 1 -} - -7z x 'v2ray-core.zip' -o'v2ray-core' -if ( -Not $? ) { exit $lastExitCode } - -mv -Force 'v2ray-core\v2ctl.exe' $OutputPath -mv -Force 'v2ray-core\v2ray.exe' $OutputPath -mv -Force 'v2ray-core\wv2ray.exe' $OutputPath - -rm -Recurse -Force v2ray-core -rm -Recurse -Force v2ray-core.zip -exit 0 \ No newline at end of file diff --git a/scripts/deps/xray-core.ps1 b/scripts/deps/xray-core.ps1 deleted file mode 100644 index 6e2e96c2..00000000 --- a/scripts/deps/xray-core.ps1 +++ /dev/null @@ -1,22 +0,0 @@ -param ( - [string] - $OutputPath -) - -try { - Invoke-WebRequest ` - -Uri 'https://github.com/XTLS/Xray-core/releases/download/v1.4.2/Xray-windows-64.zip' ` - -OutFile 'xray-core.zip' -} -catch { - exit 1 -} - -7z x 'xray-core.zip' -o'xray-core' -if ( -Not $? ) { exit $lastExitCode } - -mv -Force 'xray-core\xray.exe' $OutputPath - -rm -Recurse -Force xray-core -rm -Recurse -Force xray-core.zip -exit 0 \ No newline at end of file