diff --git a/Other/v2ray-plugin/build.ps1 b/Other/v2ray-plugin/build.ps1 new file mode 100644 index 00000000..a11830ca --- /dev/null +++ b/Other/v2ray-plugin/build.ps1 @@ -0,0 +1,19 @@ +Push-Location (Split-Path $MyInvocation.MyCommand.Path -Parent) + +git clone https://github.com/teddysun/v2ray-plugin src +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\v2ray-plugin.exe' + +Pop-Location +Pop-Location +exit $lastExitCode \ No newline at end of file diff --git a/Other/v2ray-plugin/deps.ps1 b/Other/v2ray-plugin/deps.ps1 new file mode 100644 index 00000000..e69de29b diff --git a/scripts/deps/v2ray-plugin.ps1 b/scripts/deps/v2ray-plugin.ps1 deleted file mode 100644 index 1bf4e82e..00000000 --- a/scripts/deps/v2ray-plugin.ps1 +++ /dev/null @@ -1,25 +0,0 @@ -param ( - [string] - $OutputPath -) - -try { - Invoke-WebRequest ` - -Uri 'https://github.com/teddysun/v2ray-plugin/releases/download/v4.42.1/v2ray-plugin-windows-amd64-v4.42.1.tar.gz' ` - -OutFile 'v2ray-plugin.tar.gz' -} -catch { - exit 1 -} - -7z x 'v2ray-plugin.tar.gz' -if ( -Not $? ) { exit $lastExitCode } - -7z x 'v2ray-plugin.tar' -if ( -Not $? ) { exit $lastExitCode } - -mv -Force 'v2ray-plugin_windows_amd64.exe' "$OutputPath\v2ray-plugin.exe" - -rm -Force 'v2ray-plugin.tar' -rm -Force 'v2ray-plugin.tar.gz' -exit 0 \ No newline at end of file