Chromium Code Reviews| Index: third_party/closure_compiler/bump_compiler_version |
| diff --git a/third_party/closure_compiler/bump_compiler_version b/third_party/closure_compiler/bump_compiler_version |
| new file mode 100755 |
| index 0000000000000000000000000000000000000000..8e8ec23afb4709233f220a082214f34c2c57a005 |
| --- /dev/null |
| +++ b/third_party/closure_compiler/bump_compiler_version |
| @@ -0,0 +1,40 @@ |
| +#!/bin/bash |
| +# Copyright 2014 The Chromium Authors. All rights reserved. |
| +# Use of this source code is governed by a BSD-style license that can be |
| +# found in the LICENSE file. |
| +# |
| +# Download the newest version of Closure Compiler, build it and put into Chrome |
| +# source tree. Also update externs/chrome_extensions.js. |
| +# |
| +# How to update compiler version in Chrome source: |
| +# a) Run this script. |
| +# b) Add third_party/closure_compiler/compiler/compiler.jar and |
| +# third_party/closure_compiler/externs/chrome_extensions.js |
| +# 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.
|
| + |
| +readonly SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" |
| +readonly TEMP_DIR=$(mktemp -d) |
| + |
| +cleanup() { |
| + rm -rf "${TEMP_DIR}" |
| +} |
| + |
|
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.
|
| +cd "${TEMP_DIR}" |
| +echo "Cloning Closure Compiler repo" |
| +git clone https://github.com/google/closure-compiler.git |
| + |
| +cd closure-compiler |
| +echo "Building Closure Compiler" |
| +ant jar |
| + |
| +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
|
| + echo "Copying compiler.jar and chrome_extensions.js" |
| + cp build/compiler.jar "${SCRIPT_DIR}/compiler/" |
| + cp contrib/externs/chrome_extensions.js "${SCRIPT_DIR}/externs/" |
| + echo "Done" |
| + cleanup |
| +else |
| + 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
|
| + cleanup |
| + exit 1 |
| +fi |