From 1b85207b3da4ae044062bb049032ba1f5c33077a Mon Sep 17 00:00:00 2001 From: bridiver Date: Tue, 22 Oct 2019 16:23:43 -0700 Subject: [PATCH] allow npm config override of target_os and target_arch for android/ios devs fix https://github.com/brave/brave-browser/issues/6582 --- build/lib/config.js | 3 ++- build/scripts/commands.js | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/build/lib/config.js b/build/lib/config.js index 3e3ed50bb932..caa5d9976014 100755 --- a/build/lib/config.js +++ b/build/lib/config.js @@ -45,7 +45,8 @@ const Config = function () { this.defaultGClientFile = path.join(this.rootDir, '.gclient') this.gClientFile = process.env.BRAVE_GCLIENT_FILE || this.defaultGClientFile this.gClientVerbose = getNPMConfig(['gclient_verbose']) || false - this.targetArch = 'x64' + this.targetArch = getNPMConfig(['target_arch']) || 'x64' + this.targetOS = getNPMConfig(['target_os']) this.gypTargetArch = 'x64' this.targetApkBase ='classic' this.androidOverrideVersionName = '0.0.0' diff --git a/build/scripts/commands.js b/build/scripts/commands.js index a76a7dbbd6fa..0cfc18531ef9 100755 --- a/build/scripts/commands.js +++ b/build/scripts/commands.js @@ -36,7 +36,7 @@ program .command('build') .option('-C ', 'build config (out/Debug, out/Release') .option('--target_os ', 'target OS') - .option('--target_arch ', 'target architecture', 'x64') + .option('--target_arch ', 'target architecture') .option('--target_apk_base ', 'target Android OS apk (classic, modern, mono)', 'classic') .option('--android_override_version_name ', 'Android version number') .option('--mac_signing_identifier ', 'The identifier to use for signing') @@ -58,7 +58,7 @@ program program .command('create_dist') .option('-C ', 'build config (out/Debug, out/Release') - .option('--target_arch ', 'target architecture', 'x64') + .option('--target_arch ', 'target architecture') .option('--mac_signing_identifier ', 'The identifier to use for signing') .option('--mac_installer_signing_identifier ', 'The identifier to use for signing the installer') .option('--mac_signing_keychain ', 'The identifier to use for signing', 'login') @@ -76,7 +76,7 @@ program program .command('upload') - .option('--target_arch ', 'target architecture', 'x64') + .option('--target_arch ', 'target architecture') .action(upload) program @@ -127,7 +127,7 @@ program program .command('cibuild') - .option('--target_arch ', 'target architecture', 'x64') + .option('--target_arch ', 'target architecture') .action((options) => { options.official_build = true build('Release', options) @@ -142,7 +142,7 @@ program .option('--single_process', 'uses a single process to run tests to help with debugging') .option('--test_launcher_jobs ', 'Number of jobs to launch') .option('--target_os ', 'target OS') - .option('--target_arch ', 'target architecture', 'x64') + .option('--target_arch ', 'target architecture') .arguments('[build_config]') .action(test)