Files
v2rayA/build.ps1
T
Markson GuGa Beyond cffe97ca3d core: migrate xray-core from git submodule to go mod and port QUIC outbounds to daeuniverse/outbound
The vendored core/xray submodule is dropped. xray-core is now pinned via a
go mod pseudo-version resolving to v26.7.28 (commit 5ca6f4b7); v26 tags are
not directly resolvable because Xray's module path lacks the /v26 suffix, so
the pin must be made by commit hash. CI workflows and the AUR PKGBUILD no
longer need "submodules: recursive" / "git submodule update".

The juicity and tuic outbounds are ported from softwind to
github.com/daeuniverse/outbound (temporarily replaced with an olicesx fork
pending sticky-ip support):

- Dialer calls use DialContext; the network string is decoded with
  netproxy.ParseMagicNetwork instead of a "udp" prefix check, since it may
  be binary-encoded via netproxy.MagicNetwork.
- A packetConnAdapter wraps xray's UDP dial result: outbound asserts the
  underlay conn to netproxy.PacketConn whose ReadFrom/WriteTo signatures
  (netip.AddrPort / string) differ from net.PacketConn, while xray returns
  *internet.PacketConnWrapper.
2026-09-18 13:15:45 +08:00

71 lines
2.4 KiB
PowerShell

Write-Host $PSScriptRoot
Function Get-build-tools(){
if ([String]::IsNullOrEmpty($(Get-Command git -ErrorAction ignore))) {
Write-Output "You don't install git, please install it and add it to your path."
$We_Should_Exit_Now = $true
}
if ([String]::IsNullOrEmpty($(Get-Command yarn -ErrorAction ignore))) {
Write-Output "You don't install yarn, please install it and add it to your path."
Write-Output "You should also install Node.js to make yarn work fine."
$We_Should_Exit_Now = $true
}
if ([String]::IsNullOrEmpty($(Get-Command go -ErrorAction ignore))) {
Write-Output "You don't install go, please install it and add it to your path."
$We_Should_Exit_Now = $true
}
if ($We_Should_Exit_Now) {
Exit 1
}
}
Function Build-v2rayA(){
#Get OS
if ($env:GOOS -eq "windows" -or $env:WinDir) {
$v2rayaBin = "v2raya.exe"
$v2rayaCoreBin = "v2raya_core.exe"
} else {
$v2rayaBin = "v2raya"
$v2rayaCoreBin = "v2raya_core"
}
#Get Paths
$TerminalPath = Get-Item -LiteralPath ./ | ForEach-Object -Process { $_.FullName }
$CurrentPath = $PSScriptRoot
Set-Location -Path "$CurrentPath"
#Get Informations
$DateLong = git log -1 --format="%cd" --date=short
$Date = $DateLong -replace "-"; ""
$count = git rev-list --count HEAD
$commit = git rev-parse --short HEAD
#Version
$version = "unstable-$date.r$count.$commit"
#Disable CGO
${env:CGO_ENABLED} = "0"
#Set yarn's output path
${env:OUTPUT_DIR} = "$CurrentPath/service/server/router/web"
#Build Web Panel
Set-Location -Path "$CurrentPath/gui"
yarn; yarn build
#Build v2raya-core (xray-core from go mod + MultiObservatory)
Set-Location -Path "$CurrentPath/core"
${env:CGO_ENABLED} = "0"
go build -trimpath -trimpath -ldflags "-s -w" -o "$CurrentPath/$v2rayaCoreBin" ./main
#Build v2rayA
Set-Location -Path "$CurrentPath/service"
if ($env:GOOS -eq "windows") {
$v2rayaBin = "v2raya.exe"
} elseif ($env:WinDir -and !$env:GOOS) {
$v2rayaBin = "v2raya.exe"
} else {
$v2rayaBin = "v2raya"
}
go build -trimpath -tags "tinytun" -ldflags "-X github.com/v2rayA/v2rayA/conf.Version=$version -s -w" -o "$CurrentPath/$v2rayaBin"
Set-Location -Path "$TerminalPath"
}
Set-PSDebug -Trace 1
Get-build-tools
Build-v2rayA
Set-PSDebug -Trace 0