OLD | NEW |
1 # This Source Code Form is subject to the terms of the Mozilla Public | 1 # This Source Code Form is subject to the terms of the Mozilla Public |
2 # License, v. 2.0. If a copy of the MPL was not distributed with this | 2 # License, v. 2.0. If a copy of the MPL was not distributed with this |
3 # file, You can obtain one at http://mozilla.org/MPL/2.0/. | 3 # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
4 | 4 |
5 import os | 5 import os |
6 import sys | 6 import sys |
7 import re | 7 import re |
8 import subprocess | 8 import subprocess |
9 import shutil | 9 import shutil |
10 import buildtools | 10 import buildtools |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 else: | 221 else: |
222 host, port = ('localhost', args[0]) | 222 host, port = ('localhost', args[0]) |
223 | 223 |
224 import buildtools.packagerGecko as packager | 224 import buildtools.packagerGecko as packager |
225 packager.autoInstall(baseDir, type, host, port, multicompartment=multicompar
tment) | 225 packager.autoInstall(baseDir, type, host, port, multicompartment=multicompar
tment) |
226 | 226 |
227 | 227 |
228 def createDevEnv(baseDir, scriptName, opts, args, type): | 228 def createDevEnv(baseDir, scriptName, opts, args, type): |
229 if type == 'safari': | 229 if type == 'safari': |
230 import buildtools.packagerSafari as packager | 230 import buildtools.packagerSafari as packager |
| 231 elif type == 'edge': |
| 232 import buildtools.packagerEdge as packager |
231 else: | 233 else: |
232 import buildtools.packagerChrome as packager | 234 import buildtools.packagerChrome as packager |
233 | 235 |
234 file = StringIO() | 236 file = StringIO() |
235 packager.createBuild(baseDir, type=type, outFile=file, devenv=True, releaseB
uild=True) | 237 packager.createBuild(baseDir, type=type, outFile=file, devenv=True, releaseB
uild=True) |
236 | 238 |
237 from buildtools.packager import getDevEnvPath | 239 from buildtools.packager import getDevEnvPath |
238 devenv_dir = getDevEnvPath(baseDir, type) | 240 devenv_dir = getDevEnvPath(baseDir, type) |
239 | 241 |
240 shutil.rmtree(devenv_dir, ignore_errors=True) | 242 shutil.rmtree(devenv_dir, ignore_errors=True) |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 with addCommand(runAutoInstall, 'autoinstall') as command: | 474 with addCommand(runAutoInstall, 'autoinstall') as command: |
473 command.shortDescription = 'Install extension automatically' | 475 command.shortDescription = 'Install extension automatically' |
474 command.description = 'Will automatically install the extension in a browser
running Extension Auto-Installer. If host parameter is omitted assumes that the
browser runs on localhost.' | 476 command.description = 'Will automatically install the extension in a browser
running Extension Auto-Installer. If host parameter is omitted assumes that the
browser runs on localhost.' |
475 command.params = '[<host>:]<port>' | 477 command.params = '[<host>:]<port>' |
476 command.addOption('Create a build for leak testing', short='m', long='multi-
compartment') | 478 command.addOption('Create a build for leak testing', short='m', long='multi-
compartment') |
477 command.supportedTypes = ('gecko') | 479 command.supportedTypes = ('gecko') |
478 | 480 |
479 with addCommand(createDevEnv, 'devenv') as command: | 481 with addCommand(createDevEnv, 'devenv') as command: |
480 command.shortDescription = 'Set up a development environment' | 482 command.shortDescription = 'Set up a development environment' |
481 command.description = 'Will set up or update the devenv folder as an unpacke
d extension folder for development.' | 483 command.description = 'Will set up or update the devenv folder as an unpacke
d extension folder for development.' |
482 command.supportedTypes = ('gecko-webext', 'chrome', 'safari') | 484 command.supportedTypes = ('gecko-webext', 'chrome', 'safari', 'edge') |
483 | 485 |
484 with addCommand(setupTranslations, 'setuptrans') as command: | 486 with addCommand(setupTranslations, 'setuptrans') as command: |
485 command.shortDescription = 'Sets up translation languages' | 487 command.shortDescription = 'Sets up translation languages' |
486 command.description = 'Sets up translation languages for the project on crow
din.net.' | 488 command.description = 'Sets up translation languages for the project on crow
din.net.' |
487 command.params = '[options] project-key' | 489 command.params = '[options] project-key' |
488 command.supportedTypes = ('gecko', 'chrome', 'generic') | 490 command.supportedTypes = ('gecko', 'chrome', 'generic') |
489 | 491 |
490 with addCommand(updateTranslationMaster, 'translate') as command: | 492 with addCommand(updateTranslationMaster, 'translate') as command: |
491 command.shortDescription = 'Updates translation master files' | 493 command.shortDescription = 'Updates translation master files' |
492 command.description = 'Updates the translation master files in the project o
n crowdin.net.' | 494 command.description = 'Updates the translation master files in the project o
n crowdin.net.' |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 if option in ('-h', '--help'): | 600 if option in ('-h', '--help'): |
599 usage(scriptName, type, command) | 601 usage(scriptName, type, command) |
600 sys.exit() | 602 sys.exit() |
601 commands[command](baseDir, scriptName, opts, args, type) | 603 commands[command](baseDir, scriptName, opts, args, type) |
602 else: | 604 else: |
603 print 'Command %s is not supported for this application type' % comm
and | 605 print 'Command %s is not supported for this application type' % comm
and |
604 usage(scriptName, type) | 606 usage(scriptName, type) |
605 else: | 607 else: |
606 print 'Command %s is unrecognized' % command | 608 print 'Command %s is unrecognized' % command |
607 usage(scriptName, type) | 609 usage(scriptName, type) |
OLD | NEW |