From 228e31731aefe0c705e4225df560aaf4e4d2e7f0 Mon Sep 17 00:00:00 2001 From: Ghislain Seguin Date: Thu, 12 Jan 2012 15:32:20 -0800 Subject: [PATCH] Rewrote "docs" target to take advantage of r.js' whole project optimization added build profile docs.build.js --- Makefile | 16 +++++++--------- build/docs.build.js | 18 ++++++++++++++++++ 2 files changed, 25 insertions(+), 9 deletions(-) create mode 100644 build/docs.build.js diff --git a/Makefile b/Makefile index 21d8ea40..27b73ce8 100644 --- a/Makefile +++ b/Makefile @@ -78,16 +78,14 @@ css: init # ------------------------------------------------- -docs: init css js +docs: init # Create the Demos/Docs/Tests/Tools - @@mkdir -p tmp/${NAME} - @@cp -R index.html docs experiments external js/jquery.js tests css/themes/${THEME}/images tmp/${NAME}/ - @@cp ${OUTPUT}/${NAME}.min.css ${OUTPUT}/${NAME}.min.js tmp/${NAME}/ - # ... Update the JavaScript and CSS paths - @@find tmp/${NAME} -type f \ - \( -name '*.html' -o -name '*.php' \) \ - -exec perl -pi -e \ - 's|js/"|${NAME}.min.js"|g;s|css/themes/default/|${NAME}.min.css|g;s|js/jquery.js"|jquery.js"|g' {} \; + # ... Build the docs bundle + @@java -XX:ReservedCodeCacheSize=64m \ + -classpath build/js.jar:build/google-compiler-20111003.jar org.mozilla.javascript.tools.shell.Main \ + external/r.js/dist/r.js \ + -o build/docs.build.js \ + dir=../tmp/${NAME} # ... Move and zip up the the whole folder @@cd tmp; zip -rq ../${OUTPUT}/${NAME}.docs.zip ${NAME} @@mv tmp/${NAME} ${OUTPUT}/demos diff --git a/build/docs.build.js b/build/docs.build.js new file mode 100644 index 00000000..3ff2fe94 --- /dev/null +++ b/build/docs.build.js @@ -0,0 +1,18 @@ +({ + appDir: "..", + baseUrl: "js", + dir: "../compiled/demos", + + optimize: "none", + + //Finds require() dependencies inside a require() or define call. + findNestedDependencies: true, + + modules: [ + { + name: "jquery.mobile.docs" + } + ], + + dirExclusionRegExp: /^\.|^build|^compiled/ +}) \ No newline at end of file