Skip to content

Commit

Permalink
Fix 2 issues in docs building
Browse files Browse the repository at this point in the history
1) Object type specifications "Object<index, type>" were broken

2) The js compiler would create a partial base.js even on failure
which means the next build would skip building the docs.

Review URL: http://codereview.chromium.org/457011

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33366 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
gman@chromium.org committed Nov 30, 2009
1 parent ca7b36c commit 3e7824d
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 28 deletions.
37 changes: 21 additions & 16 deletions o3d/documentation/build_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,22 +323,27 @@ def main(argv):
os.path.splitext(os.path.basename(f))[0] + '.js')
for f in idl_list]

DeleteOldDocs(MakePath(docs_outpath))
BuildJavaScriptForDocsFromIDLs(idl_files, docs_js_outpath)
BuildO3DDocsFromJavaScript([o3d_extra_externs_path] + docs_js_files,
o3d_docs_ezt_outpath, o3d_docs_html_outpath)
BuildO3DClassHierarchy(o3d_docs_html_outpath)
BuildJavaScriptForExternsFromIDLs(idl_files, externs_js_outpath)
BuildO3DExternsFile(externs_js_outpath,
o3d_extra_externs_path,
o3d_externs_path)
BuildO3DJSDocs(o3djs_files + [o3d_externs_path], o3djs_docs_ezt_outpath,
o3djs_docs_html_outpath, o3djs_exports_path)
CopyStaticFiles(o3d_docs_ezt_outpath, o3d_docs_html_outpath)
BuildCompiledO3DJS(o3djs_files + [o3djs_exports_path],
externs_path,
o3d_externs_path,
compiled_o3djs_outpath)
try:
DeleteOldDocs(MakePath(docs_outpath))
BuildJavaScriptForDocsFromIDLs(idl_files, docs_js_outpath)
BuildO3DDocsFromJavaScript([o3d_extra_externs_path] + docs_js_files,
o3d_docs_ezt_outpath, o3d_docs_html_outpath)
BuildO3DClassHierarchy(o3d_docs_html_outpath)
BuildJavaScriptForExternsFromIDLs(idl_files, externs_js_outpath)
BuildO3DExternsFile(externs_js_outpath,
o3d_extra_externs_path,
o3d_externs_path)
BuildO3DJSDocs(o3djs_files + [o3d_externs_path], o3djs_docs_ezt_outpath,
o3djs_docs_html_outpath, o3djs_exports_path)
CopyStaticFiles(o3d_docs_ezt_outpath, o3d_docs_html_outpath)
BuildCompiledO3DJS(o3djs_files + [o3djs_exports_path],
externs_path,
o3d_externs_path,
compiled_o3djs_outpath)
except Exception:
if os.path.exists(compiled_o3djs_outpath):
os.unlink(compiled_o3djs_outpath)
raise


if __name__ == '__main__':
Expand Down
24 changes: 12 additions & 12 deletions o3d/documentation/jsdoc-toolkit-templates/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -742,19 +742,19 @@ function linkifySingleType(place, type) {
linkifySingleType(place, type.substring(7, closingAngle)) + '>';
}
} else if (startsWith(type, 'Object.<')) {
var closingAngle = getIndexOfClosingCharacter(type, 6);
if (closingAngle < 0) {
generatePlaceError(place, 'Unmatched "<" in Object type : ' + type);
} else {
var objectSpec = type.substring(8, closingAngle);
var elements = objectSpec.split(/\s*,\s*/);
if (elements.length != 2) {
generatePlaceError(place, 'An Object spec must have exactly 2 types');
}
link = 'Object.&lt;' +
linkifySingleType(place, elements[0]) + ', ' +
linkifySingleType(place, elements[1]) + '>';
var closingAngle = getIndexOfClosingCharacter(type, 7);
if (closingAngle < 0) {
generatePlaceError(place, 'Unmatched "<" in Object type : ' + type);
} else {
var objectSpec = type.substring(8, closingAngle);
var elements = objectSpec.split(/\s*,\s*/);
if (elements.length != 2) {
generatePlaceError(place, 'An Object spec must have exactly 2 types');
}
link = 'Object.&lt;' +
linkifySingleType(place, elements[0]) + ', ' +
linkifySingleType(place, elements[1]) + '>';
}
} else if (startsWith(type, 'function(')) {
var closingParen = getIndexOfClosingCharacter(type, 8);
if (closingParen < 0) {
Expand Down

0 comments on commit 3e7824d

Please sign in to comment.