Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(client): move client/go output into root #2109

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
18 changes: 14 additions & 4 deletions client/electron/app_paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,13 @@ export function getAppPath() {

export function pathToEmbeddedTun2socksBinary() {
return path.join(
unpackedAppPath(), 'client', 'output', 'build',
(isWindows ? 'windows' : 'linux'),
'tun2socks' + (isWindows ? '.exe' : ''));
unpackedAppPath(),
Copy link
Contributor Author

@daniellacosse daniellacosse Aug 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jyyi1 do you know if this will work? do you mind testing it?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should all be able to validate the builds. This is an example where the tun-only mode would help. It's one of our biggest pain points. We need to prioritize that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed!

'output',
'build',
'client',
isWindows ? 'windows' : 'linux',
'tun2socks' + (isWindows ? '.exe' : '')
);
}

/**
Expand All @@ -60,5 +64,11 @@ export function pathToEmbeddedOutlineService() {
if (isWindows) {
return getAppPath();
}
return path.join(unpackedAppPath(), 'client', 'tools', 'outline_proxy_controller', 'dist');
return path.join(
unpackedAppPath(),
'client',
'tools',
'outline_proxy_controller',
'dist'
);
}
6 changes: 3 additions & 3 deletions client/go/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ 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: '{{joinPath .OUT_DIR "/bin"}}'
OUTPUT_DIR: '{{joinPath .REPO_ROOT "output"}}'
daniellacosse marked this conversation as resolved.
Show resolved Hide resolved
BIN_DIR: '{{joinPath .OUTPUT_DIR "/bin"}}'
OUT_DIR: '{{joinPath .OUTPUT_DIR "/build/client"}}'
MOBILE_PKG: "{{.TASKFILE_DIR}}/outline/tun2socks"
GOMOBILE_BIND_CMD: "env PATH=\"{{.BIN_DIR}}:${PATH}\" '{{.BIN_DIR}}/gomobile' bind -ldflags='-s -w'"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
/* Begin PBXFileReference section */
522987032C4F273E009EE577 /* PacketTunnelProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PacketTunnelProvider.h; sourceTree = "<group>"; };
522987042C4F273E009EE577 /* PacketTunnelProvider.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PacketTunnelProvider.m; sourceTree = "<group>"; };
5229870D2C4F2873009EE577 /* Tun2socks.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = Tun2socks.xcframework; path = ../../../../output/build/apple/Tun2socks.xcframework; sourceTree = "<group>"; };
5229870D2C4F2873009EE577 /* Tun2socks.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = Tun2socks.xcframework; path = ../../../../../output/build/client/apple/Tun2socks.xcframework; sourceTree = "<group>"; };
52334EAC2B0D58AD00817E56 /* VpnExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = VpnExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; };
52334EAE2B0D58AD00817E56 /* NetworkExtension.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = NetworkExtension.framework; path = System/Library/Frameworks/NetworkExtension.framework; sourceTree = SDKROOT; };
52334EB32B0D58AD00817E56 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
Expand Down
17 changes: 13 additions & 4 deletions client/src/cordova/plugin/android/scripts/copy_third_party.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env node

// Copyright 2018 The Outline Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -18,8 +16,19 @@ const fs = require('fs/promises');
// const child_process = require('child_process');
const path = require('node:path');

const ANDROID_LIBS_FOLDER_PATH = path.join('plugins', 'cordova-plugin-outline', 'android', 'libs');
const TUN2SOCKS_ANDROID_FOLDER_PATH = path.join('output', 'build', 'android');
const ANDROID_LIBS_FOLDER_PATH = path.join(
'plugins',
'cordova-plugin-outline',
'android',
'libs'
);
const TUN2SOCKS_ANDROID_FOLDER_PATH = path.join(
'..',
'output',
'build',
'client',
'android'
);

module.exports = async function () {
console.log('Copying Android third party libraries...');
Expand Down
Loading