Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(364)

Unified Diff: third_party/closure_compiler/roll_closure_compiler

Issue 2796033003: New checks for Java version against Maven files. (Closed)
Patch Set: Do not call test. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/closure_compiler/roll_closure_compiler
diff --git a/third_party/closure_compiler/roll_closure_compiler b/third_party/closure_compiler/roll_closure_compiler
index fa8d01e82e491d1160cb54229c0259940c7050ca..b1f616e44b90a020fda94582ee8bf1be72189760 100755
--- a/third_party/closure_compiler/roll_closure_compiler
+++ b/third_party/closure_compiler/roll_closure_compiler
@@ -11,18 +11,6 @@
# https://dl.google.com/closure-compiler/compiler-latest.zip and unzip. And get
# the externs from rawgit.com.
-java -version 2>&1 | head -1 | egrep -q '\b1\.7'
-if [[ $? -ne 0 ]]; then
- echo "This script requires Java 1.7" >&2
- exit 1
-fi
-
-javac -version 2>&1 | egrep -q '\b1\.7'
-if [[ $? -ne 0 ]]; then
- echo "This script requires JDK 1.7" >&2
- exit 1
-fi
-
readonly SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
readonly TEMP_DIR=$(mktemp -d)
readonly EXTERNS_DIR="${SCRIPT_DIR}/externs"
@@ -63,6 +51,26 @@ EOT
)
fi
+check_jdk_version() {
+ # Pretty contrived checks modeling how we write Maven XML files.
+ if [ ! -r "$2" ]; then
+ echo "Could not find $2" >&2
+ exit 1
+ elif ! fgrep -q '<jdk.version>'$1'</jdk.version>' "$2"; then
+ echo "JDK version $1 must be specified in $2" >&2
+ exit 1
+ elif ! fgrep -q '<source>${jdk.version}</source>' "$2"; then
+ echo "Java source must be specified to be \${jdk.version} in $2" >&2
+ exit 1
+ elif ! fgrep -q '<target>${jdk.version}</target>' "$2"; then
+ echo "Java target must be specified to be \${jdk.version} in $2" >&2
+ exit 1
+ fi
+}
+
+echo "Checking JDK Version Used to Build"
+check_jdk_version 1.7 pom.xml
+
echo "Building Closure Compiler"
mvn clean install -DskipTests=true --projects com.google.javascript:closure-compiler,com.google.javascript:closure-compiler-externs
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698