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

Unified Diff: build.py

Issue 29531680: Issue 5560 - Specify the JSDoc dependency explicitly (Closed)
Patch Set: Created Aug. 30, 2017, 3:24 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | package.json » ('j') | package-lock.json » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build.py
diff --git a/build.py b/build.py
index b3c62a6e5da7a13db5091168cd9d1e86da55d0aa..a4cd328c9867fe641ae8889453ce30fca8c97ad2 100644
--- a/build.py
+++ b/build.py
@@ -411,17 +411,21 @@ def generateDocs(baseDir, scriptName, opts, args, type):
if type == 'chrome':
sources = [os.path.join(source_dir, filename) for filename in os.listdir(source_dir) if filename != 'publicSuffixList.js']
- config = os.path.join(os.path.dirname(__file__), 'jsdoc.conf')
- command = ['jsdoc', '--destination', targetDir, '--configure', config] + sources
+ buildtools_path = os.path.dirname(__file__)
+ config = os.path.join(buildtools_path, 'jsdoc.conf')
+
+ command = ['npm', 'run-script', 'jsdoc', '--', '--destination', targetDir,
+ '--configure', config] + sources
if any(opt in ('-q', '--quiet') for opt, _ in opts):
- process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ process = subprocess.Popen(command, stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE, cwd=buildtools_path)
stderr = process.communicate()[1]
retcode = process.poll()
if retcode:
sys.stderr.write(stderr)
raise subprocess.CalledProcessError(command, retcode)
else:
- subprocess.check_call(command)
+ subprocess.check_call(command, cwd=buildtools_path)
def runReleaseAutomation(baseDir, scriptName, opts, args, type):
@@ -515,7 +519,7 @@ with addCommand(showDescriptions, 'showdesc') as command:
with addCommand(generateDocs, 'docs') as command:
command.shortDescription = 'Generate documentation (requires node.js)'
- command.description = 'Generate documentation files and write them into the specified directory. This operation requires JsDoc 3 to be installed.'
+ command.description = 'Generate documentation files and write them into the specified directory.'
tlucas 2017/08/30 17:33:21 nit: While at it, how do you feel about limiting l
kzar 2017/08/31 10:54:35 Done.
command.addOption('Suppress JsDoc output', short='q', long='quiet')
command.params = '[options] <directory>'
command.supportedTypes = ('gecko', 'chrome')
« no previous file with comments | « no previous file | package.json » ('j') | package-lock.json » ('J')

Powered by Google App Engine
This is Rietveld