From 3e7824dcdcd1f84a553395630bbbe72a27612930 Mon Sep 17 00:00:00 2001 From: "gman@chromium.org" Date: Mon, 30 Nov 2009 23:02:03 +0000 Subject: [PATCH] Fix 2 issues in docs building 1) Object type specifications "Object" 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 --- o3d/documentation/build_docs.py | 37 +++++++++++-------- .../jsdoc-toolkit-templates/publish.js | 24 ++++++------ 2 files changed, 33 insertions(+), 28 deletions(-) diff --git a/o3d/documentation/build_docs.py b/o3d/documentation/build_docs.py index 8d56d4390835..ce4d2a1cb77e 100755 --- a/o3d/documentation/build_docs.py +++ b/o3d/documentation/build_docs.py @@ -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__': diff --git a/o3d/documentation/jsdoc-toolkit-templates/publish.js b/o3d/documentation/jsdoc-toolkit-templates/publish.js index 73057df0d5d0..fa990d186399 100644 --- a/o3d/documentation/jsdoc-toolkit-templates/publish.js +++ b/o3d/documentation/jsdoc-toolkit-templates/publish.js @@ -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.<' + - 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.<' + + linkifySingleType(place, elements[0]) + ', ' + + linkifySingleType(place, elements[1]) + '>'; + } } else if (startsWith(type, 'function(')) { var closingParen = getIndexOfClosingCharacter(type, 8); if (closingParen < 0) {