| OLD | NEW |
| 1 # coding: utf-8 | 1 # coding: utf-8 |
| 2 | 2 |
| 3 # This Source Code Form is subject to the terms of the Mozilla Public | 3 # This Source Code Form is subject to the terms of the Mozilla Public |
| 4 # License, v. 2.0. If a copy of the MPL was not distributed with this | 4 # License, v. 2.0. If a copy of the MPL was not distributed with this |
| 5 # file, You can obtain one at http://mozilla.org/MPL/2.0/. | 5 # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
| 6 | 6 |
| 7 import os, sys, re, subprocess, shutil, buildtools | 7 import os, sys, re, subprocess, shutil, buildtools |
| 8 from getopt import getopt, GetoptError | 8 from getopt import getopt, GetoptError |
| 9 from StringIO import StringIO | 9 from StringIO import StringIO |
| 10 from zipfile import ZipFile | 10 from zipfile import ZipFile |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 return | 371 return |
| 372 targetDir = args[0] | 372 targetDir = args[0] |
| 373 | 373 |
| 374 source_dir = os.path.join(baseDir, 'lib') | 374 source_dir = os.path.join(baseDir, 'lib') |
| 375 sources = [source_dir] | 375 sources = [source_dir] |
| 376 | 376 |
| 377 # JSDoc struggles wih huge objects: https://github.com/jsdoc3/jsdoc/issues/976 | 377 # JSDoc struggles wih huge objects: https://github.com/jsdoc3/jsdoc/issues/976 |
| 378 if type == 'chrome': | 378 if type == 'chrome': |
| 379 sources = [os.path.join(source_dir, filename) for filename in os.listdir(sou
rce_dir) if filename != 'publicSuffixList.js'] | 379 sources = [os.path.join(source_dir, filename) for filename in os.listdir(sou
rce_dir) if filename != 'publicSuffixList.js'] |
| 380 | 380 |
| 381 command = ['jsdoc', '--destination', targetDir, '--access', 'all'] + sources | 381 |
| 382 config = os.path.join(os.path.dirname(__file__), 'jsdoc.conf') |
| 383 command = ['jsdoc', '--destination', targetDir, '--configure', config] + sourc
es |
| 382 if any(opt in ('-q', '--quiet') for opt, _ in opts): | 384 if any(opt in ('-q', '--quiet') for opt, _ in opts): |
| 383 process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subproces
s.PIPE) | 385 process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subproces
s.PIPE) |
| 384 stderr = process.communicate()[1] | 386 stderr = process.communicate()[1] |
| 385 retcode = process.poll() | 387 retcode = process.poll() |
| 386 if retcode: | 388 if retcode: |
| 387 sys.stderr.write(stderr) | 389 sys.stderr.write(stderr) |
| 388 raise subprocess.CalledProcessError(command, retcode) | 390 raise subprocess.CalledProcessError(command, retcode) |
| 389 else: | 391 else: |
| 390 subprocess.check_call(command) | 392 subprocess.check_call(command) |
| 391 | 393 |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 571 if option in ('-h', '--help'): | 573 if option in ('-h', '--help'): |
| 572 usage(scriptName, type, command) | 574 usage(scriptName, type, command) |
| 573 sys.exit() | 575 sys.exit() |
| 574 commands[command](baseDir, scriptName, opts, args, type) | 576 commands[command](baseDir, scriptName, opts, args, type) |
| 575 else: | 577 else: |
| 576 print 'Command %s is not supported for this application type' % command | 578 print 'Command %s is not supported for this application type' % command |
| 577 usage(scriptName, type) | 579 usage(scriptName, type) |
| 578 else: | 580 else: |
| 579 print 'Command %s is unrecognized' % command | 581 print 'Command %s is unrecognized' % command |
| 580 usage(scriptName, type) | 582 usage(scriptName, type) |
| OLD | NEW |