| OLD | NEW |
| 1 #!/usr/bin/env bash | 1 #!/usr/bin/env bash |
| 2 # | 2 # |
| 3 | 3 |
| 4 set -x | 4 set -x |
| 5 | 5 |
| 6 # generate_patches.sh [systems] | 6 # generate_patches.sh [systems] |
| 7 # | 7 # |
| 8 # Convenience script to generate patches for JsInterop under Dartium. Do not ca
ll from build steps or tests | 8 # Convenience script to generate patches for JsInterop under Dartium. Do not ca
ll from build steps or tests |
| 9 # - call fremontcutbuilder and dartdomgenerator instead. Do not add 'real' | 9 # - call fremontcutbuilder and dartdomgenerator instead. Do not add 'real' |
| 10 # functionality here - change the python code instead. | 10 # functionality here - change the python code instead. |
| 11 # | 11 # |
| 12 # I find it essential to generate all the systems so I know if I am breaking | 12 # I find it essential to generate all the systems so I know if I am breaking |
| 13 # other systems. My habit is to run: | 13 # other systems. My habit is to run: |
| 14 # | 14 # |
| 15 # ./go.sh | 15 # ./go.sh |
| 16 # | 16 # |
| 17 # 1. After running go.sh libraries in sdk/lib may change. | 17 # 1. After running go.sh libraries in sdk/lib may change. |
| 18 # 2. Build Dartium. | 18 # 2. Build Dartium. |
| 19 # 3. Run this script and sdk/lib/js/dartium/cached_patches will be created. | 19 # 3. Run this script and sdk/lib/js/dartium/cached_patches will be created. |
| 20 # 4. Rebuild Dartium. | 20 # 4. Rebuild Dartium. |
| 21 # 5. Commit files in sdk/lib | 21 # 5. Commit files in sdk/lib |
| 22 # | 22 # |
| 23 # NOTE: If the Dart files generated from the IDLs may cause major changes which | 23 # NOTE: If the Dart files generated from the IDLs may cause major changes which |
| 24 # could cause the patch files to fail (missing classes, etc). If this | 24 # could cause the patch files to fail (missing classes, etc). If this |
| 25 # happens delete the contents of the sdk/lib/js/dartium/cached_patches.dar
t | 25 # happens delete the contents of the sdk/lib/js/dartium/cached_patches.dar
t |
| 26 # build Dartium, run this script and build Dartium again with the newly | 26 # build Dartium, run this script and build Dartium again with the newly |
| 27 # generated patches. | 27 # generated patches. |
| 28 | 28 |
| 29 ARG_OPTION="dartGenCachedPatches" |
| 30 |
| 31 LOCATION_DARTIUM="../../../out/Release" |
| 32 DARTIUM="$LOCATION_DARTIUM" |
| 33 |
| 29 if [[ "$1" != "" ]] ; then | 34 if [[ "$1" != "" ]] ; then |
| 30 DARTIUM="$1" | 35 if [[ "$1" =~ ^--roll ]]; then |
| 31 else | 36 ARG_OPTION="dartGenCachedPatchesForRoll" |
| 32 LOCATION_DARTIUM="../../../out/Release" | 37 else |
| 33 DARTIUM="$LOCATION_DARTIUM" | 38 DARTIUM="$1" |
| 39 fi |
| 40 fi |
| 41 |
| 42 if [[ "$2" != "" ]] ; then |
| 43 if [[ "$2" =~ ^--roll ]]; then |
| 44 ARG_OPTION="dartGenCachedPatchesForRoll" |
| 45 else |
| 46 DARTIUM="$2" |
| 47 fi |
| 34 fi | 48 fi |
| 35 | 49 |
| 36 DART_APP_LOCATION="file://"$PWD"/generate_app/generate_cached_patches.html" | 50 DART_APP_LOCATION="file://"$PWD"/generate_app/generate_cached_patches.html" |
| 37 DARTIUM_ARGS=" --user-data-dir=out --disable-web-security --no-sandbox --enable-
blink-features=dartGenCachedPatches" | 51 DARTIUM_ARGS=" --user-data-dir=out --disable-web-security --no-sandbox --enable-
blink-features="$ARG_OPTION"" |
| 38 CACHED_PATCHES_FILE=""$PWD"/../../sdk/lib/js/dartium/cached_patches.dart" | 52 CACHED_PATCHES_FILE=""$PWD"/../../sdk/lib/js/dartium/cached_patches.dart" |
| 39 | 53 |
| 40 cmd=""$DARTIUM"/chrome "$DARTIUM_ARGS" "$DART_APP_LOCATION" | | 54 cmd=""$DARTIUM"/chrome "$DARTIUM_ARGS" "$DART_APP_LOCATION" | |
| 41 (sed -n '/START_OF_CACHED_PATCHES/,/END_OF_CACHED_PATCHES/p') > "$CACHED_PATCH
ES_FILE"" | 55 (sed -n '/START_OF_CACHED_PATCHES/,/END_OF_CACHED_PATCHES/p') > "$CACHED_PATCH
ES_FILE"" |
| 42 | 56 |
| 43 reset && eval "${cmd}" | 57 reset && eval "${cmd}" |
| 44 | 58 |
| 45 | 59 |
| OLD | NEW |