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

chore(client/electron): move src/electron into client/electron #1958

Merged
merged 23 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/tools/build/setup_linux_android.sh → .github/scripts/android_setup_ci.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ rm android-commandline-tools.zip

PATH="${PATH}:${ANDROID_HOME}/platform-tools:${ANDROID_HOME}/cmdline-tools/tools/bin"

yes | sdkmanager "build-tools;${OUTLINE_ANDROID_BUILD_TOOLS_VERSION}" "ndk;${OUTLINE_ANDROID_NDK_VERSION}"
yes | sdkmanager "build-tools;${OUTLINE_ANDROID_BUILD_TOOLS_VERSION}" "ndk;${OUTLINE_ANDROID_NDK_VERSION}"
6 changes: 3 additions & 3 deletions .github/workflows/build_and_test_debug_client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
go-version-file: '${{ github.workspace }}/go.mod'

- name: Build Linux Client
run: npm run action src/electron/build linux
run: npm run action client/electron/build linux

windows_debug_build:
name: Windows Debug Build
Expand Down Expand Up @@ -99,7 +99,7 @@ jobs:
go-version-file: '${{ github.workspace }}/go.mod'

- name: Build Windows Client
run: npm run action src/electron/build windows
run: npm run action client/electron/build windows

macos_debug_build:
name: MacOS Debug Build
Expand Down Expand Up @@ -257,7 +257,7 @@ jobs:
java-version: 11

- name: Setup Android
run: bash ./client/tools/build/setup_linux_android.sh
run: bash ./.github/scripts/android_setup_ci.sh

- name: Build Android Client
run: npm run action client/src/cordova/build android -- --verbose
2 changes: 1 addition & 1 deletion client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Each platform is handled differently:

1. [Developing for Apple **(MacOS and iOS)**](src/cordova/apple)
2. [Developing for **Android**](src/cordova/android)
3. [Developing for Electron **(Windows and Linux)**](src/electron)
3. [Developing for Electron **(Windows and Linux)**](electron)

## Error reporting

Expand Down
2 changes: 1 addition & 1 deletion src/electron/README.md → client/electron/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Unlike the Android and Apple clients, the Windows and Linux clients use the Electron framework, rather than Cordova.

To build the Electron clients, run (it will also package an installer executable into `build/dist`):
To build the Electron clients, run (it will also package an installer executable into `output/client/electron/build`):

```sh
npm run action client/electron/build [windows|linux]
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,14 @@ import fs from 'fs/promises';
import path from 'path';
import url from 'url';

import copydir from 'copy-dir';
import electron, {Platform} from 'electron-builder';
import minimist from 'minimist';

import {getBuildParameters} from '../../client/src/build/get_build_parameters.mjs';
import {getRootDir} from '../build/get_root_dir.mjs';
import {runAction} from '../build/run_action.mjs';
import {getRootDir} from '../../src/build/get_root_dir.mjs';
import {runAction} from '../../src/build/run_action.mjs';
import {getBuildParameters} from '../src/build/get_build_parameters.mjs';




const ELECTRON_BUILD_DIR = 'build';
const ELECTRON_BUILD_DIR = 'output';
const ELECTRON_PLATFORMS = ['linux', 'windows'];

export async function main(...parameters) {
Expand Down Expand Up @@ -55,15 +51,12 @@ export async function main(...parameters) {

await runAction('client/src/www/build', ...parameters);
await runAction('client/src/tun2socks/build', ...parameters);
await runAction('src/electron/build_main', ...parameters);
await runAction('client/electron/build_main', ...parameters);

await copydir.sync(
path.join(getRootDir(), 'src', 'electron', 'icons'),
path.join(getRootDir(), ELECTRON_BUILD_DIR, 'icons')
);
await fs.mkdir(path.join(getRootDir(), ELECTRON_BUILD_DIR, 'client', 'electron'), {recursive: true});

const electronConfig = JSON.parse(
await fs.readFile(path.resolve(getRootDir(), 'src', 'electron', 'electron-builder.json'))
await fs.readFile(path.resolve(getRootDir(), 'client', 'electron', 'electron-builder.json'))
);

// build electron binary
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ import path from 'path';
import url from 'url';

import electronMainWebpackConfigs from './webpack_electron_main.mjs';
import {getBuildParameters} from '../../client/src/build/get_build_parameters.mjs';
import {getWebpackBuildMode} from '../../client/src/build/get_webpack_build_mode.mjs';
import {runWebpack} from '../../client/src/build/run_webpack.mjs';
import {getRootDir} from '../build/get_root_dir.mjs';
import {runAction} from '../build/run_action.mjs';
import {getRootDir} from '../../src/build/get_root_dir.mjs';
import {runAction} from '../../src/build/run_action.mjs';
import {getBuildParameters} from '../src/build/get_build_parameters.mjs';
daniellacosse marked this conversation as resolved.
Show resolved Hide resolved
import {getWebpackBuildMode} from '../src/build/get_webpack_build_mode.mjs';
import {runWebpack} from '../src/build/run_webpack.mjs';

const ELECTRON_BUILD_DIR = 'build';
const ELECTRON_BUILD_DIR = 'output';
const ELECTRON_PLATFORMS = ['linux', 'windows'];

export async function main(...parameters) {
Expand Down Expand Up @@ -58,7 +58,7 @@ export async function main(...parameters) {
windowsEnvironment += `\n!define SENTRY_URL "<debug>"`;
}

await fs.writeFile(path.resolve(getRootDir(), ELECTRON_BUILD_DIR, 'env.nsh'), windowsEnvironment);
await fs.writeFile(path.resolve(getRootDir(), ELECTRON_BUILD_DIR, 'client', 'electron', 'env.nsh'), windowsEnvironment);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
import * as dns from 'dns';

import {timeoutPromise} from '@outline/infrastructure/timeout_promise';
import * as errors from '../../client/src/www/model/errors';

import * as errors from '../src/www/model/errors';

const DNS_LOOKUP_TIMEOUT_MS = 10000;

Expand Down
Loading
Loading