2017-01-26 12:16:54 -07:00
|
|
|
const program = require('commander');
|
|
|
|
const path = require('path')
|
|
|
|
const fs = require('fs-extra')
|
|
|
|
const config = require('../lib/config')
|
|
|
|
const util = require('../lib/util')
|
|
|
|
const build = require('../lib/build')
|
2017-05-06 16:11:39 -07:00
|
|
|
const versions = require('../lib/versions')
|
2017-01-26 12:16:54 -07:00
|
|
|
const start = require('../lib/start')
|
|
|
|
const updatePatches = require('../lib/updatePatches')
|
2018-02-15 09:00:49 -05:00
|
|
|
const pullL10n = require('../lib/pullL10n')
|
|
|
|
const pushL10n = require('../lib/pushL10n')
|
2018-01-07 22:06:09 -05:00
|
|
|
const createDist = require('../lib/createDist')
|
2018-02-06 18:56:00 -05:00
|
|
|
const upload = require('../lib/upload')
|
2018-03-14 12:11:49 -07:00
|
|
|
const test = require('../lib/test')
|
2017-01-26 12:16:54 -07:00
|
|
|
|
|
|
|
program
|
|
|
|
.version(process.env.npm_package_version)
|
|
|
|
|
2017-05-06 16:11:39 -07:00
|
|
|
program
|
|
|
|
.command('versions')
|
|
|
|
.action(versions)
|
|
|
|
|
2017-01-26 12:16:54 -07:00
|
|
|
program
|
|
|
|
.command('build')
|
|
|
|
.option('-C <build_dir>', 'build config (out/Debug, out/Release')
|
|
|
|
.option('--target_arch <target_arch>', 'target architecture', 'x64')
|
2017-02-10 10:39:16 -07:00
|
|
|
.option('--debug_build <debug_build>', 'keep debugging symbols')
|
|
|
|
.option('--official_build <official_build>', 'force official build settings')
|
2018-03-24 21:57:33 -04:00
|
|
|
.option('--brave_google_api_key <brave_google_api_key>')
|
|
|
|
.option('--brave_google_api_endpoint <brave_google_api_endpoint>')
|
2017-01-26 12:16:54 -07:00
|
|
|
.option('--no_branding_update', 'don\'t copy BRANDING to the chrome theme dir')
|
|
|
|
.arguments('[build_config]')
|
|
|
|
.action(build)
|
|
|
|
|
2018-01-07 22:06:09 -05:00
|
|
|
program
|
|
|
|
.command('create_dist')
|
|
|
|
.option('--mac_signing_identifier', 'The identifier to use for signing')
|
|
|
|
.option('--target_arch <target_arch>', 'target architecture', 'x64')
|
|
|
|
.option('--debug_build <debug_build>', 'keep debugging symbols')
|
|
|
|
.option('--official_build <official_build>', 'force official build settings')
|
2018-03-26 21:46:52 +03:00
|
|
|
.option('--no_branding_update', 'don\'t copy BRANDING to the chrome theme dir')
|
2018-01-07 22:06:09 -05:00
|
|
|
.action(createDist)
|
|
|
|
|
2018-02-06 18:56:00 -05:00
|
|
|
program
|
|
|
|
.command('upload')
|
|
|
|
.option('--target_arch <target_arch>', 'target architecture', 'x64')
|
|
|
|
.action(upload)
|
|
|
|
|
2017-01-26 12:16:54 -07:00
|
|
|
program
|
|
|
|
.command('start')
|
|
|
|
.option('--v [log_level]', 'set log level to [log_level]', parseInt, '0')
|
2017-08-29 15:11:17 -07:00
|
|
|
.option('--user_data_dir_name [base_name]', 'set user data directory base name to [base_name]', 'brave-development')
|
2017-03-19 12:16:15 -04:00
|
|
|
.option('--no_sandbox', 'disable the sandbox')
|
2017-01-26 12:16:54 -07:00
|
|
|
.arguments('[build_config]')
|
|
|
|
.action(start)
|
|
|
|
|
2018-02-15 09:00:49 -05:00
|
|
|
program
|
|
|
|
.command('pull_l10n')
|
|
|
|
.action(pullL10n)
|
|
|
|
|
|
|
|
program
|
|
|
|
.command('push_l10n')
|
|
|
|
.action(pushL10n)
|
|
|
|
|
2017-01-26 12:16:54 -07:00
|
|
|
program
|
|
|
|
.command('update_patches')
|
|
|
|
.action(updatePatches)
|
|
|
|
|
|
|
|
program
|
|
|
|
.command('cibuild')
|
|
|
|
.option('--target_arch <target_arch>', 'target architecture', 'x64')
|
|
|
|
.action((options) => {
|
2017-02-10 10:39:16 -07:00
|
|
|
options.official_build = true
|
2017-01-26 12:16:54 -07:00
|
|
|
build('Release', options)
|
|
|
|
})
|
|
|
|
|
2018-03-14 12:11:49 -07:00
|
|
|
program
|
|
|
|
.command('test <suite>')
|
2018-03-14 13:30:56 -07:00
|
|
|
.option('--v [log_level]', 'set log level to [log_level]', parseInt, '0')
|
2018-03-14 12:11:49 -07:00
|
|
|
.action(test)
|
|
|
|
|
2017-01-26 12:16:54 -07:00
|
|
|
program
|
|
|
|
.parse(process.argv)
|