Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 #!/bin/bash | |
| 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 | |
| 4 # found in the LICENSE file. | |
| 5 # | |
| 6 # Download the newest version of Closure Compiler, build it and put into Chrome | |
| 7 # source tree. Also update externs/chrome_extensions.js. | |
| 8 # | |
| 9 # How to update compiler version in Chrome source: | |
| 10 # a) Run this script. | |
| 11 # b) Add third_party/closure_compiler/compiler/compiler.jar and | |
| 12 # third_party/closure_compiler/externs/chrome_extensions.js | |
| 13 # c) Commit. | |
|
Dan Beam
2014/09/18 21:58:11
^ I don't think L9-13 are particularly useful
Vitaly Pavlenko
2014/09/18 23:16:10
Done.
| |
| 14 | |
| 15 readonly SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | |
| 16 readonly TEMP_DIR=$(mktemp -d) | |
| 17 | |
| 18 cleanup() { | |
| 19 rm -rf "${TEMP_DIR}" | |
| 20 } | |
| 21 | |
|
Dan Beam
2014/09/18 21:58:11
add
trap cleanup SIGINT SIGHUP SIGTERM
to make
Vitaly Pavlenko
2014/09/18 23:16:10
Done. However, I can't reproduce the use case. Eg.
| |
| 22 cd "${TEMP_DIR}" | |
| 23 echo "Cloning Closure Compiler repo" | |
| 24 git clone https://github.com/google/closure-compiler.git | |
| 25 | |
| 26 cd closure-compiler | |
| 27 echo "Building Closure Compiler" | |
| 28 ant jar | |
| 29 | |
| 30 if [[ "$?" -eq 0 ]]; then | |
|
Dan Beam
2014/09/18 21:58:11
nit:
if [[ $? -ne 0 ]]; then
echo "Failed to bu
Dan Beam
2014/09/18 21:58:11
nit: $? will never be empty here, so you don't *ne
Vitaly Pavlenko
2014/09/18 23:16:10
Done.
Vitaly Pavlenko
2014/09/18 23:16:10
As I understand the style guide, I should apply th
| |
| 31 echo "Copying compiler.jar and chrome_extensions.js" | |
| 32 cp build/compiler.jar "${SCRIPT_DIR}/compiler/" | |
| 33 cp contrib/externs/chrome_extensions.js "${SCRIPT_DIR}/externs/" | |
| 34 echo "Done" | |
| 35 cleanup | |
| 36 else | |
| 37 echo "Failed to build jar, copy nothing" | |
|
Dan Beam
2014/09/18 21:58:11
probably ought to output this to stderr, e.g.
e
Vitaly Pavlenko
2014/09/18 23:16:10
Ought to:
https://google-styleguide.googlecode.com
| |
| 38 cleanup | |
| 39 exit 1 | |
| 40 fi | |
| OLD | NEW |