Skip to content

Commit

Permalink
do it in the javascript
Browse files Browse the repository at this point in the history
  • Loading branch information
daniellacosse committed Feb 5, 2024
1 parent 9497404 commit 55402b0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
5 changes: 1 addition & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ GOBIND=env PATH="$(GOBIN):$(PATH)" "$(GOMOBILE)" bind
IMPORT_HOST=github.com
IMPORT_PATH=$(IMPORT_HOST)/Jigsaw-Code/outline-client

.PHONY: android apple linux windows browser
.PHONY: android apple linux windows

all: android apple linux windows

Expand Down Expand Up @@ -35,9 +35,6 @@ $(BUILDDIR)/apple/Tun2socks.xcframework: $(BUILDDIR)/ios/Tun2socks.xcframework $
find $^ -name "Tun2socks.framework" -type d | xargs -I {} echo " -framework {} " | \
xargs xcrun xcodebuild -create-xcframework -output "$@"

browser:
echo "Browser target not needed for tun2socks"

XGO=$(GOBIN)/xgo
TUN2SOCKS_VERSION=v1.16.11
XGO_LDFLAGS='-w -X main.version=$(TUN2SOCKS_VERSION)'
Expand Down
12 changes: 11 additions & 1 deletion src/tun2socks/build.action.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,18 @@ export async function main(...parameters) {

const currentPlatform = os.platform() === 'win32' ? 'windows' : os.platform();

if (targetPlatform === 'browser') {
return;
}

if (targetPlatform === currentPlatform && ['linux', 'windows'].includes(targetPlatform)) {
return spawnStream('go', 'build', '-o', `output/build/${targetPlatform}/tun2socks`, 'github.com/Jigsaw-Code/outline-client/src/tun2socks/outline/electron');
return spawnStream(
'go',
'build',
'-o',
`output/build/${targetPlatform}/tun2socks`,
'github.com/Jigsaw-Code/outline-client/src/tun2socks/outline/electron'
);
}

await spawnStream('make', ['ios', 'macos', 'maccatalyst'].includes(targetPlatform) ? 'apple' : targetPlatform);
Expand Down

0 comments on commit 55402b0

Please sign in to comment.