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.
6 # Download the newest version of Closure Compiler, build it and put into Chrome
7 # source tree. Also update externs/chrome_extensions.js.
9 readonly SCRIPT_DIR
="$(cd "$
(dirname "${BASH_SOURCE[0]}")" && pwd)"
10 readonly TEMP_DIR
=$
(mktemp
-d)
16 trap cleanup SIGINT SIGHUP SIGTERM
19 echo "Cloning Closure Compiler repo"
20 git clone https
://github.com
/google
/closure-compiler.git
23 echo "Building Closure Compiler"
26 if [[ "$?" -ne 0 ]]; then
27 echo "Failed to build jar, copying nothing" >&2
32 echo "Copying compiler.jar and chrome_extensions.js"
33 cp build
/compiler.jar
"${SCRIPT_DIR}/compiler/"
34 cp contrib
/externs
/chrome_extensions.js
"${SCRIPT_DIR}/externs/"