| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 # Copyright 2014 The Chromium Authors. All rights reserved. | 2 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 # | 5 # |
| 6 # Download the newest version of Closure Compiler, build it and put into Chrome | 6 # Download the newest version of Closure Compiler, build it and put into Chrome |
| 7 # source tree. Also update externs/chrome_extensions.js. | 7 # source tree. Also update externs/chrome_extensions.js. |
| 8 # |
| 9 # TODO(dbeam): we don't really need to build the compiler any more. We used to |
| 10 # need to because we built a custom runner. We could probably just curl |
| 11 # https://dl.google.com/closure-compiler/compiler-latest.zip and unzip. And get |
| 12 # the externs from rawgit.com. |
| 8 | 13 |
| 9 java -version 2>&1 | head -1 | egrep -q '\b1\.7' | 14 java -version 2>&1 | head -1 | egrep -q '\b1\.7' |
| 10 if [[ $? -ne 0 ]]; then | 15 if [[ $? -ne 0 ]]; then |
| 11 echo "This script requires Java 1.7" >&2 | 16 echo "This script requires Java 1.7" >&2 |
| 12 exit 1 | 17 exit 1 |
| 13 fi | 18 fi |
| 14 | 19 |
| 15 javac -version 2>&1 | egrep -q '\b1\.7' | 20 javac -version 2>&1 | egrep -q '\b1\.7' |
| 16 if [[ $? -ne 0 ]]; then | 21 if [[ $? -ne 0 ]]; then |
| 17 echo "This script requires JDK 1.7" >&2 | 22 echo "This script requires JDK 1.7" >&2 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 | 65 |
| 61 echo "Building Closure Compiler" | 66 echo "Building Closure Compiler" |
| 62 mvn install -DskipTests=true --projects com.google.javascript:closure-compiler | 67 mvn install -DskipTests=true --projects com.google.javascript:closure-compiler |
| 63 | 68 |
| 64 if [[ "$?" -ne 0 ]]; then | 69 if [[ "$?" -ne 0 ]]; then |
| 65 echo "Failed to build jar, copying nothing" >&2 | 70 echo "Failed to build jar, copying nothing" >&2 |
| 66 cleanup | 71 cleanup |
| 67 exit 1 | 72 exit 1 |
| 68 fi | 73 fi |
| 69 | 74 |
| 70 # TODO(dbeam): this .jar seems to be a bit bigger than the jar previously built | 75 # TODO(dbeam): the Maven-built jar seems a little bigger than the ant version. |
| 71 # by ant. I tried many other jars in target/, but none of them were able to | |
| 72 # build the runner.jar without issue. | |
| 73 cp target/closure-compiler-1.0-SNAPSHOT.jar "${SCRIPT_DIR}/compiler/compiler.jar
" | 76 cp target/closure-compiler-1.0-SNAPSHOT.jar "${SCRIPT_DIR}/compiler/compiler.jar
" |
| 74 | 77 |
| 75 echo "Re-building runner.jar" | |
| 76 "${SCRIPT_DIR}/runner/build_runner_jar.py" | |
| 77 if [[ "$?" -ne 0 ]]; then | |
| 78 echo "Failed to build runner.jar, roll unsuccessful" | |
| 79 cleanup | |
| 80 exit 1 | |
| 81 fi | |
| 82 | |
| 83 readonly WARNING="$(cat <<EOT | 78 readonly WARNING="$(cat <<EOT |
| 84 // SSSSSSSSSSSSSSS TTTTTTTTTTTTTTTTTTTTTTT OOOOOOOOO PPPPPPPPPPPPPPPP
P | 79 // SSSSSSSSSSSSSSS TTTTTTTTTTTTTTTTTTTTTTT OOOOOOOOO PPPPPPPPPPPPPPPP
P |
| 85 // SS:::::::::::::::ST:::::::::::::::::::::T OO:::::::::OO P:::::::::::::::
:P | 80 // SS:::::::::::::::ST:::::::::::::::::::::T OO:::::::::OO P:::::::::::::::
:P |
| 86 // S:::::SSSSSS::::::ST:::::::::::::::::::::T OO:::::::::::::OO P::::::PPPPPP:::
::P | 81 // S:::::SSSSSS::::::ST:::::::::::::::::::::T OO:::::::::::::OO P::::::PPPPPP:::
::P |
| 87 // S:::::S SSSSSSST:::::TT:::::::TT:::::TO:::::::OOO:::::::OPP:::::P P::
:::P | 82 // S:::::S SSSSSSST:::::TT:::::::TT:::::TO:::::::OOO:::::::OPP:::::P P::
:::P |
| 88 // S:::::S TTTTTT T:::::T TTTTTTO::::::O O::::::O P::::P P::
:::P | 83 // S:::::S TTTTTT T:::::T TTTTTTO::::::O O::::::O P::::P P::
:::P |
| 89 // S:::::S T:::::T O:::::O O:::::O P::::P P::
:::P | 84 // S:::::S T:::::T O:::::O O:::::O P::::P P::
:::P |
| 90 // S::::SSSS P::::PPPPPP:::
::P | 85 // S::::SSSS P::::PPPPPP:::
::P |
| 91 // SS::::::SSSSS This file is generated. To update it, P:::::::::::::
PP | 86 // SS::::::SSSSS This file is generated. To update it, P:::::::::::::
PP |
| 92 // SSS::::::::SS run roll_closure_compiler. P::::PPPPPPPPP | 87 // SSS::::::::SS run roll_closure_compiler. P::::PPPPPPPPP |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 echo "${head_range}" | 135 echo "${head_range}" |
| 141 if [[ ! -z "${extensions_range}" ]]; then echo "${extensions_range}"; fi | 136 if [[ ! -z "${extensions_range}" ]]; then echo "${extensions_range}"; fi |
| 142 if [[ ! -z "${polymer_range}" ]]; then echo "${polymer_range}"; fi | 137 if [[ ! -z "${polymer_range}" ]]; then echo "${polymer_range}"; fi |
| 143 echo | 138 echo |
| 144 echo "TBR=" | 139 echo "TBR=" |
| 145 echo "BUG='" | 140 echo "BUG='" |
| 146 echo | 141 echo |
| 147 echo "git cl upload" | 142 echo "git cl upload" |
| 148 | 143 |
| 149 cleanup | 144 cleanup |
| OLD | NEW |