| OLD | NEW |
| (Empty) |
| 1 #!/bin/sh | |
| 2 | |
| 3 # A polymer application compiled with dart2js depends on | |
| 4 # 4 js files: | |
| 5 # 1) packages/shadow_dom/shadow_dom.debug.js | |
| 6 # 2) packages/custom_element/custom-elements.debug.js | |
| 7 # 3) packages/browser/interop.js | |
| 8 # 4) index.html_bootstrap.dart.precompiled.js | |
| 9 | |
| 10 # This script rolls 1, 2, 3, and 4 into index.html_bootstrap.dart.js | |
| 11 | |
| 12 # Relative paths to four scripts. | |
| 13 SHADOW_DOM="packages/shadow_dom/shadow_dom.debug.js" | |
| 14 CUSTOM_ELEMENTS="packages/custom_element/custom-elements.debug.js" | |
| 15 INTEROP="packages/browser/interop.js" | |
| 16 OBSERVATORY="index.html_bootstrap.dart.precompiled.js" | |
| 17 OBSERVATORY_DEVTOOLS="index_devtools.html_bootstrap.dart.precompiled.js" | |
| 18 | |
| 19 # Base directory | |
| 20 BASE="out/web" | |
| 21 DEPLOYED="deployed/web" | |
| 22 | |
| 23 INPUT="$BASE/$SHADOW_DOM" | |
| 24 INPUT="$INPUT $BASE/$CUSTOM_ELEMENTS" | |
| 25 INPUT="$INPUT $BASE/$INTEROP" | |
| 26 | |
| 27 INPUT_STANDALONE="$INPUT $BASE/$OBSERVATORY" | |
| 28 OUTPUT_STANDALONE="$DEPLOYED/index.html_bootstrap.dart.js" | |
| 29 | |
| 30 # Rolling | |
| 31 cat $INPUT_STANDALONE > $OUTPUT_STANDALONE | |
| 32 cp $BASE/index.html $DEPLOYED/index.html | |
| 33 | |
| 34 INPUT_DEVTOOLS="$INPUT $BASE/$OBSERVATORY_DEVTOOLS" | |
| 35 OUTPUT_DEVTOOLS="$DEPLOYED/index_devtools.html_bootstrap.dart.js" | |
| 36 | |
| 37 cat $INPUT_DEVTOOLS > $OUTPUT_DEVTOOLS | |
| 38 cp $BASE/index_devtools.html $DEPLOYED/index_devtools.html | |
| 39 | |
| 40 # Kill package <script> tags added by polymer compilation. | |
| 41 # This kills harmless (but distracting) Chrome Developer Console spam | |
| 42 # about missing scripts. | |
| 43 perl -pi -e 's/<script src="packages.*"><\/script>//g' \ | |
| 44 $DEPLOYED/index.html | |
| 45 perl -pi -e 's/<script src="packages.*"><\/script>//g' \ | |
| 46 $DEPLOYED/index_devtools.html | |
| 47 | |
| 48 # The polymer compilation step munges <img> src urls and adds a packages/ | |
| 49 # prefix to the url. Because of how we deploy we must undo this and remove | |
| 50 # the prefix. Without this, images will show up as broken links. | |
| 51 perl -pi -e 's/packages\/observatory\/src\/elements\///g' \ | |
| 52 $DEPLOYED/index.html | |
| 53 perl -pi -e 's/packages\/observatory\/src\/elements\///g' \ | |
| 54 $DEPLOYED/index_devtools.html | |
| OLD | NEW |