diff --git a/client/electron/app_paths.ts b/client/electron/app_paths.ts index b4866ca0ed..7b397d3c62 100644 --- a/client/electron/app_paths.ts +++ b/client/electron/app_paths.ts @@ -45,9 +45,13 @@ export function getAppPath() { export function pathToEmbeddedTun2socksBinary() { return path.join( - unpackedAppPath(), 'client', 'output', 'build', - (isWindows ? 'windows' : 'linux'), - 'tun2socks' + (isWindows ? '.exe' : '')); + unpackedAppPath(), + 'output', + 'build', + 'client', + isWindows ? 'windows' : 'linux', + 'tun2socks' + (isWindows ? '.exe' : '') + ); } /** @@ -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' + ); } diff --git a/client/go/Taskfile.yml b/client/go/Taskfile.yml index 70619397ff..1803d9963c 100644 --- a/client/go/Taskfile.yml +++ b/client/go/Taskfile.yml @@ -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_ROOT: '{{joinPath .REPO_ROOT "output"}}' + BIN_DIR: '{{joinPath .OUTPUT_ROOT "/bin"}}' + OUT_DIR: '{{joinPath .OUTPUT_ROOT "/build/client"}}' MOBILE_PKG: "{{.TASKFILE_DIR}}/outline/tun2socks" GOMOBILE_BIND_CMD: "env PATH=\"{{.BIN_DIR}}:${PATH}\" '{{.BIN_DIR}}/gomobile' bind -ldflags='-s -w'" diff --git a/client/src/cordova/android/OutlineAndroidLib/outline/build.gradle b/client/src/cordova/android/OutlineAndroidLib/outline/build.gradle index f08084e379..8d742aeaea 100644 --- a/client/src/cordova/android/OutlineAndroidLib/outline/build.gradle +++ b/client/src/cordova/android/OutlineAndroidLib/outline/build.gradle @@ -34,9 +34,9 @@ android { dependencies { // To make this project editable directly in the source tree, we need to load - // tun2socks.aar from its original path in the third_party directory. We do + // tun2socks.aar from its original path in the output directory. We do // this by relative path: - compileOnly fileTree(dir: '../../../../../output/build/android', + compileOnly fileTree(dir: '../../../../../../output/build/client/android', include: ['tun2socks.aar']) // Note: A flatDir repository might be preferable, but this is not compatible // with a composite build (https://github.com/gradle/gradle/issues/911). diff --git a/client/src/cordova/apple/OutlineLib/OutlineLib.xcodeproj/project.pbxproj b/client/src/cordova/apple/OutlineLib/OutlineLib.xcodeproj/project.pbxproj index 3345a1c056..46695ec763 100644 --- a/client/src/cordova/apple/OutlineLib/OutlineLib.xcodeproj/project.pbxproj +++ b/client/src/cordova/apple/OutlineLib/OutlineLib.xcodeproj/project.pbxproj @@ -17,7 +17,7 @@ /* Begin PBXFileReference section */ 522987032C4F273E009EE577 /* PacketTunnelProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PacketTunnelProvider.h; sourceTree = ""; }; 522987042C4F273E009EE577 /* PacketTunnelProvider.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PacketTunnelProvider.m; sourceTree = ""; }; - 5229870D2C4F2873009EE577 /* Tun2socks.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = Tun2socks.xcframework; path = ../../../../output/build/apple/Tun2socks.xcframework; sourceTree = ""; }; + 5229870D2C4F2873009EE577 /* Tun2socks.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = Tun2socks.xcframework; path = ../../../../../output/build/client/apple/Tun2socks.xcframework; sourceTree = ""; }; 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 = ""; }; diff --git a/client/src/cordova/plugin/android/scripts/copy_third_party.js b/client/src/cordova/plugin/android/scripts/copy_third_party.js index cbe6e8bc34..7ec794205e 100644 --- a/client/src/cordova/plugin/android/scripts/copy_third_party.js +++ b/client/src/cordova/plugin/android/scripts/copy_third_party.js @@ -1,5 +1,3 @@ -#!/usr/bin/env node - // Copyright 2018 The Outline Authors // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -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...');