-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into sbruens/readme
- Loading branch information
Showing
9 changed files
with
218 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
node_modules | ||
.idea | ||
.task | ||
.vs/ | ||
.vscode | ||
*.DS_Store | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
version: '3' | ||
|
||
set: [pipefail] | ||
|
||
run: when_changed | ||
|
||
includes: | ||
client:tun2socks: ./client/src/tun2socks/Taskfile.yml | ||
|
||
tasks: | ||
clean: | ||
deps: | ||
- client:tun2socks:clean | ||
cmds: | ||
- rm -rf .task |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
version: '3' | ||
|
||
vars: | ||
# This needs to be updated if the file moves. | ||
REPO_ROOT: '{{joinPath .TASKFILE_DIR "../../.."}}' | ||
# TODO: Output to $REPO_ROOT/output/client/tun2socks instead. | ||
OUT_DIR: '{{joinPath .REPO_ROOT "client/output/build"}}' | ||
BIN_DIR: "{{.OUT_DIR}}/build" | ||
MOBILE_PKG: "{{.TASKFILE_DIR}}/outline/tun2socks" | ||
GOMOBILE_BIND_CMD: "env PATH=\"{{.BIN_DIR}}:${PATH}\" '{{.BIN_DIR}}/gomobile' bind -ldflags='-s -w'" | ||
|
||
tasks: | ||
electron: | ||
desc: "Build the tun2socks binary for Electron platforms" | ||
internal: true | ||
requires: {vars: [TARGET_OS]} | ||
vars: | ||
# TODO(fortuna): remove this, it's not really needed since we don't release it separately anymore. | ||
TUN2SOCKS_VERSION: "v1.16.11" | ||
OUTPUT: '{{.OUT_DIR}}/{{.TARGET_OS}}/tun2socks{{if eq .TARGET_OS "windows"}}.exe{{end}}' | ||
cmds: | ||
- rm -rf "{{dir .OUTPUT}}" && mkdir -p "{{dir .OUTPUT}}" | ||
# Linker flags: https://pkg.go.dev/cmd/link | ||
# -s Omit the symbol table and debug information. | ||
# -w Omit the DWARF symbol table. | ||
# -X Set the value of the string variable. | ||
- | | ||
{{if ne OS .TARGET_OS -}} | ||
GOOS={{.TARGET_OS}} GOARCH=amd64 CGO_ENABLED=1 CC='zig cc -target x86_64-{{.TARGET_OS}}' | ||
{{- end}} \ | ||
go build -trimpath -ldflags="-s -w -X=main.version={{.TUN2SOCKS_VERSION}}" -o '{{.OUTPUT}}' '{{.TASKFILE_DIR}}/outline/electron' | ||
windows: | ||
desc: "Build the tun2socks binary for Windows" | ||
cmds: [{task: electron, vars: {TARGET_OS: "windows"}}] | ||
|
||
linux: | ||
desc: "Build the tun2socks binary for Linux" | ||
cmds: [{task: electron, vars: {TARGET_OS: "linux"}}] | ||
|
||
android: | ||
desc: "Build the tun2socks.aar library for Android" | ||
vars: | ||
TARGET_DIR: "{{.OUT_DIR}}/android" | ||
# ANDROID_API must match the minSdkVersion that the Android client supports. | ||
ANDROID_API: 22 | ||
preconditions: | ||
- sh: '[[ -d "$ANDROID_HOME" ]]' | ||
msg: "Must set ANDROID_HOME" | ||
- sh: '[[ -d "$ANDROID_NDK" ]]' | ||
msg: "Must set ANDROID_NDK" | ||
cmds: | ||
- rm -rf "{{.TARGET_DIR}}" && mkdir -p "{{.TARGET_DIR}}" | ||
- "{{.GOMOBILE_BIND_CMD}} -target=android -androidapi '{{.ANDROID_API}}' -o '{{.TARGET_DIR}}/tun2socks.aar' '{{.TASKFILE_DIR}}/outline/tun2socks' '{{.TASKFILE_DIR}}/outline/shadowsocks'" | ||
deps: ["gomobile"] | ||
|
||
ios-only: | ||
desc: "Build the Tun2socks.xcframework library for iOS only" | ||
internal: true | ||
vars: | ||
TARGET_DIR: '{{.OUT_DIR}}/ios' | ||
# TARGET_IOS_VERSION must match the target version that the iOS client supports. | ||
TARGET_IOS_VERSION: 12.0 | ||
cmds: | ||
- rm -rf "{{.TARGET_DIR}}" && mkdir -p "{{.TARGET_DIR}}" | ||
- "{{.GOMOBILE_BIND_CMD}} -target=ios,iossimulator -iosversion={{.TARGET_IOS_VERSION}} -bundleid org.outline.tun2socks -o '{{.TARGET_DIR}}/Tun2socks.xcframework' '{{.TASKFILE_DIR}}/outline/tun2socks' '{{.TASKFILE_DIR}}/outline/shadowsocks'" | ||
deps: ["gomobile"] | ||
|
||
macos-only: | ||
desc: "Build the Tun2socks.xcframework library for macOS only" | ||
internal: true | ||
vars: | ||
TARGET_DIR: '{{.OUT_DIR}}/macos' | ||
# MACOSX_DEPLOYMENT_TARGET must match the version the version set in the XCode project. | ||
MACOSX_DEPLOYMENT_TARGET: 10.14 | ||
# TARGET_IOS_VERSION must be at least 13.1 for macCatalyst and >= the iOS TARGET_IOS_VERSION. | ||
TARGET_IOS_VERSION: 13.1 | ||
cmds: | ||
- rm -rf "{{.TARGET_DIR}}" && mkdir -p "{{.TARGET_DIR}}" | ||
- export MACOSX_DEPLOYMENT_TARGET={{.MACOSX_DEPLOYMENT_TARGET}}; {{.GOMOBILE_BIND_CMD}} -target=macos,maccatalyst -iosversion={{.TARGET_IOS_VERSION}} -bundleid org.outline.tun2socks -o '{{.TARGET_DIR}}/Tun2socks.xcframework' '{{.TASKFILE_DIR}}/outline/tun2socks' '{{.TASKFILE_DIR}}/outline/shadowsocks' | ||
deps: ["gomobile"] | ||
|
||
apple: | ||
desc: "Build combined Tun2socks.xcframework library for Apple platforms" | ||
aliases: [ios, macos, maccatalyst] | ||
vars: | ||
TARGET_DIR: '{{.OUT_DIR}}/apple' | ||
cmds: | ||
- rm -rf "{{.TARGET_DIR}}" && mkdir -p "{{.TARGET_DIR}}" | ||
- | | ||
find '{{.OUT_DIR}}/macos/Tun2socks.xcframework' '{{.OUT_DIR}}/ios/Tun2socks.xcframework' -name "Tun2socks.framework" -type d | | ||
xargs -I {} echo " -framework {} " | | ||
xargs xcrun xcodebuild -create-xcframework -output '{{.TARGET_DIR}}/Tun2socks.xcframework' | ||
deps: ["ios-only", "macos-only"] | ||
|
||
browser: | ||
desc: "Placeholder for the browser build. Does nothing" | ||
|
||
gomobile: | ||
desc: "Build Go Mobile" | ||
internal: true | ||
cmds: | ||
- mkdir -p "{{.BIN_DIR}}" | ||
- go build -o "{{.BIN_DIR}}" golang.org/x/mobile/cmd/gomobile golang.org/x/mobile/cmd/gobind | ||
sources: ["{{.REPO_ROOT}}/go.sum"] | ||
generates: ["{{.BIN_DIR}}/gomobile", "{{.BIN_DIR}}/gobind"] | ||
|
||
clean: | ||
cmds: | ||
- rm -rf '{{.OUT_DIR}}' | ||
- go clean -i -r '{{.TASKFILE_DIR}}/outline/tun2socks' '{{.TASKFILE_DIR}}/outline/shadowsocks' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,41 @@ | ||
module github.com/Jigsaw-Code/outline-apps | ||
|
||
go 1.20 | ||
go 1.21 | ||
|
||
require ( | ||
github.com/Jigsaw-Code/outline-sdk v0.0.14-0.20240216220040-f741c57bf854 | ||
github.com/Jigsaw-Code/outline-sdk/x v0.0.0-20240223000159-142376ee10ea | ||
github.com/crazy-max/xgo v0.30.0 | ||
github.com/eycorsican/go-tun2socks v1.16.11 | ||
github.com/stretchr/testify v1.8.2 | ||
github.com/go-task/task/v3 v3.36.0 | ||
github.com/stretchr/testify v1.9.0 | ||
golang.org/x/mobile v0.0.0-20231127183840-76ac6878050a | ||
golang.org/x/sys v0.15.0 | ||
golang.org/x/sys v0.19.0 | ||
) | ||
|
||
require ( | ||
github.com/Masterminds/semver/v3 v3.2.1 // indirect | ||
github.com/davecgh/go-spew v1.1.1 // indirect | ||
github.com/fatih/color v1.16.0 // indirect | ||
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect | ||
github.com/joho/godotenv v1.5.1 // indirect | ||
github.com/klauspost/cpuid/v2 v2.0.9 // indirect | ||
github.com/mattn/go-colorable v0.1.13 // indirect | ||
github.com/mattn/go-isatty v0.0.20 // indirect | ||
github.com/mattn/go-zglob v0.0.4 // indirect | ||
github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect | ||
github.com/pmezard/go-difflib v1.0.0 // indirect | ||
github.com/radovskyb/watcher v1.0.7 // indirect | ||
github.com/sajari/fuzzy v1.0.0 // indirect | ||
github.com/shadowsocks/go-shadowsocks2 v0.1.5 // indirect | ||
github.com/songgao/water v0.0.0-20200317203138-2b4b6d7c09d8 // indirect | ||
golang.org/x/crypto v0.17.0 // indirect | ||
github.com/spf13/pflag v1.0.5 // indirect | ||
github.com/zeebo/xxh3 v1.0.2 // indirect | ||
golang.org/x/crypto v0.18.0 // indirect | ||
golang.org/x/mod v0.14.0 // indirect | ||
golang.org/x/net v0.19.0 // indirect | ||
golang.org/x/sync v0.5.0 // indirect | ||
golang.org/x/tools v0.16.0 // indirect | ||
golang.org/x/net v0.20.0 // indirect | ||
golang.org/x/sync v0.7.0 // indirect | ||
golang.org/x/term v0.19.0 // indirect | ||
golang.org/x/tools v0.17.0 // indirect | ||
gopkg.in/yaml.v3 v3.0.1 // indirect | ||
mvdan.cc/sh/v3 v3.8.0 // indirect | ||
) |
Oops, something went wrong.