Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: build.py

Issue 6215705351421952: Issue 2254 - Ignore stderr when jsdoc completes successfull (Closed)
Patch Set: Created April 1, 2015, 10:59 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 print 'No target directory specified for the documentation' 367 print 'No target directory specified for the documentation'
368 usage(scriptName, type, 'docs') 368 usage(scriptName, type, 'docs')
369 return 369 return
370 targetDir = args[0] 370 targetDir = args[0]
371 371
372 command = ['jsdoc', 372 command = ['jsdoc',
373 '--destination', targetDir, 373 '--destination', targetDir,
374 '--access', 'all', 374 '--access', 'all',
375 os.path.join(baseDir, 'lib')] 375 os.path.join(baseDir, 'lib')]
376 if any(opt in ('-q', '--quiet') for opt, _ in opts): 376 if any(opt in ('-q', '--quiet') for opt, _ in opts):
377 subprocess.check_output(command) 377 process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subproces s.PIPE)
378 stderr = process.communicate()[1]
379 retcode = process.poll()
380 if retcode:
381 sys.stderr.write(stderr)
382 raise subprocess.CalledProcessError(command, retcode)
378 else: 383 else:
379 subprocess.check_call(command) 384 subprocess.check_call(command)
380 385
381 def runReleaseAutomation(baseDir, scriptName, opts, args, type): 386 def runReleaseAutomation(baseDir, scriptName, opts, args, type):
382 keyFiles = [] 387 keyFiles = []
383 downloadsRepo = os.path.join(baseDir, '..', 'downloads') 388 downloadsRepo = os.path.join(baseDir, '..', 'downloads')
384 for option, value in opts: 389 for option, value in opts:
385 if option in ('-k', '--key'): 390 if option in ('-k', '--key'):
386 keyFiles.append(value) 391 keyFiles.append(value)
387 elif option in ('-d', '--downloads'): 392 elif option in ('-d', '--downloads'):
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 if option in ('-h', '--help'): 565 if option in ('-h', '--help'):
561 usage(scriptName, type, command) 566 usage(scriptName, type, command)
562 sys.exit() 567 sys.exit()
563 commands[command](baseDir, scriptName, opts, args, type) 568 commands[command](baseDir, scriptName, opts, args, type)
564 else: 569 else:
565 print 'Command %s is not supported for this application type' % command 570 print 'Command %s is not supported for this application type' % command
566 usage(scriptName, type) 571 usage(scriptName, type)
567 else: 572 else:
568 print 'Command %s is unrecognized' % command 573 print 'Command %s is unrecognized' % command
569 usage(scriptName, type) 574 usage(scriptName, type)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld