mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-02-20 23:47:21 -05:00
Target oriented building and windows x86 and arm support.
This commit is contained in:
parent
0527d40f21
commit
338300248c
2
core.go
2
core.go
@ -2,7 +2,7 @@
|
|||||||
package core
|
package core
|
||||||
|
|
||||||
const (
|
const (
|
||||||
Version = "0.5"
|
Version = "0.6"
|
||||||
Codename = "Post Apocalypse"
|
Codename = "Post Apocalypse"
|
||||||
Intro = "A stable and unbreakable connection for everyone."
|
Intro = "A stable and unbreakable connection for everyone."
|
||||||
)
|
)
|
||||||
|
@ -2,34 +2,38 @@
|
|||||||
|
|
||||||
VERSION=$(sed -n 's/.*Version.*=.*\"\([^"]*\)\".*/\1/p' $GOPATH/src/github.com/v2ray/v2ray-core/core.go)
|
VERSION=$(sed -n 's/.*Version.*=.*\"\([^"]*\)\".*/\1/p' $GOPATH/src/github.com/v2ray/v2ray-core/core.go)
|
||||||
|
|
||||||
REL_PATH=$GOPATH/bin/$VERSION
|
BIN_PATH=$GOPATH/bin
|
||||||
if [ -d "$REL_PATH" ]; then
|
mkdir -p $BIN_PATH
|
||||||
rm -rf "$REL_PATH"
|
|
||||||
fi
|
|
||||||
|
|
||||||
mkdir -p $REL_PATH
|
|
||||||
mkdir -p $REL_PATH/config
|
|
||||||
|
|
||||||
cp -R $GOPATH/src/github.com/v2ray/v2ray-core/release/config/* $REL_PATH/config/
|
|
||||||
|
|
||||||
function build {
|
function build {
|
||||||
local GOOS=$1
|
local GOOS=$1
|
||||||
local GOARCH=$2
|
local GOARCH=$2
|
||||||
local EXT=$3
|
local SUFFIX=$3
|
||||||
|
local EXT=$4
|
||||||
|
|
||||||
|
local REL_PATH=$BIN_PATH/v2ray_${VERSION}${SUFFIX}
|
||||||
local TARGET=$REL_PATH/v2ray${EXT}
|
local TARGET=$REL_PATH/v2ray${EXT}
|
||||||
GOOS=${GOOS} GOARCH=${GOARCH} go build -o ${TARGET} -compiler gc github.com/v2ray/v2ray-core/release/server
|
if [ -d "$REL_PATH" ]; then
|
||||||
|
rm -rf "$REL_PATH"
|
||||||
|
fi
|
||||||
|
mkdir -p $REL_PATH/config
|
||||||
|
cp -R $GOPATH/src/github.com/v2ray/v2ray-core/release/config/* $REL_PATH/config/
|
||||||
|
GOOS=${GOOS} GOARCH=${GOARCH} go build -o ${TARGET} -compiler gc github.com/v2ray/v2ray-core/release/server
|
||||||
|
|
||||||
|
ZIP_FILE=$BIN_PATH/v2ray${SUFFIX}.zip
|
||||||
|
if [ -f $ZIP_FILE ]; then
|
||||||
|
rm -f $ZIP_FILE
|
||||||
|
fi
|
||||||
|
|
||||||
|
pushd $BIN_PATH
|
||||||
|
zip -r $ZIP_FILE ./v2ray_${VERSION}${SUFFIX}/*
|
||||||
|
popd
|
||||||
}
|
}
|
||||||
|
|
||||||
build "darwin" "amd64" "-macos"
|
build "darwin" "amd64" "-macos" "-macos"
|
||||||
build "windows" "amd64" "-windows-64.exe"
|
build "windows" "amd64" "-windows-64" "-windows-64.exe"
|
||||||
build "linux" "amd64" "-linux-64"
|
build "windows" "amd64" "-windows-32" "-windows-32.exe"
|
||||||
build "linux" "386" "-linux-32"
|
build "linux" "amd64" "-linux-64" "-linux-64"
|
||||||
|
build "linux" "386" "-linux-32" "-linux-32"
|
||||||
|
build "linux" "arm" "-armv6" "-armv6"
|
||||||
|
|
||||||
ZIP_FILE=$GOPATH/bin/v2ray.zip
|
|
||||||
if [ -f $ZIP_FILE ]; then
|
|
||||||
rm -f $ZIP_FILE
|
|
||||||
fi
|
|
||||||
|
|
||||||
pushd $GOPATH/bin/
|
|
||||||
zip -r $ZIP_FILE ./$VERSION/*
|
|
||||||
popd
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user