From 697efccea885f22efa2e43c46861f3799a8f58f9 Mon Sep 17 00:00:00 2001 From: Kelvin Jin Date: Thu, 15 Oct 2020 02:20:27 -0700 Subject: [PATCH] Use newer Closure deps builder in JS build (#2513) * Use newer Closure deps builder in JS build * Update JS compiler build file reference and instructions Co-authored-by: penmetsaa --- javascript/README.md | 6 ++++-- javascript/build.xml | 14 +++++++------- .../i18n/phonenumbers/asyoutypeformatter_test.js | 2 ++ javascript/i18n/phonenumbers/demo.js | 1 + .../i18n/phonenumbers/phonenumberutil_test.js | 2 ++ .../i18n/phonenumbers/shortnumberinfo_test.js | 2 ++ 6 files changed, 18 insertions(+), 9 deletions(-) diff --git a/javascript/README.md b/javascript/README.md index a1973df22..c60356075 100644 --- a/javascript/README.md +++ b/javascript/README.md @@ -32,8 +32,10 @@ If you don't checkout the dependencies next to libphonenumber: How to compile: =============== -1. Build Closure's compiler.jar: - `mvn -DskipTests` +1. Build the Closure Compiler JAR file by following the directions on the + [Closure Compiler README](https://github.com/google/closure-compiler/tree/master/README.md). + If this step doesn't work, try updating your local copy of each of the + repositories listed above before filing an issue. 2. Compile the demo.js and all its dependencies to one file: `demo-compiled.js`: `ant -f javascript/build.xml compile-demo` diff --git a/javascript/build.xml b/javascript/build.xml index 037153452..cb605fd4a 100644 --- a/javascript/build.xml +++ b/javascript/build.xml @@ -4,7 +4,7 @@ + value="${closure-compiler.dir}/bazel-bin/compiler_unshaded_deploy.jar" /> - + - + @@ -98,7 +98,7 @@ - + @@ -110,7 +110,7 @@ - + @@ -118,7 +118,7 @@ - + @@ -126,7 +126,7 @@ - + diff --git a/javascript/i18n/phonenumbers/asyoutypeformatter_test.js b/javascript/i18n/phonenumbers/asyoutypeformatter_test.js index 14531b5d9..8b5d00736 100644 --- a/javascript/i18n/phonenumbers/asyoutypeformatter_test.js +++ b/javascript/i18n/phonenumbers/asyoutypeformatter_test.js @@ -24,6 +24,8 @@ * * @author Nikolaos Trogkanis */ +goog.provide('i18n.phonenumbers.AsYouTypeFormatterTest'); +goog.setTestOnly(); goog.require('goog.testing.jsunit'); goog.require('i18n.phonenumbers.AsYouTypeFormatter'); diff --git a/javascript/i18n/phonenumbers/demo.js b/javascript/i18n/phonenumbers/demo.js index 85637bf6b..02c40c9a4 100644 --- a/javascript/i18n/phonenumbers/demo.js +++ b/javascript/i18n/phonenumbers/demo.js @@ -20,6 +20,7 @@ * * @author Nikolaos Trogkanis */ +goog.provide('i18n.phonenumbers.demo'); goog.require('goog.dom'); goog.require('goog.json'); diff --git a/javascript/i18n/phonenumbers/phonenumberutil_test.js b/javascript/i18n/phonenumbers/phonenumberutil_test.js index 0f2dd511b..daf4632c3 100644 --- a/javascript/i18n/phonenumbers/phonenumberutil_test.js +++ b/javascript/i18n/phonenumbers/phonenumberutil_test.js @@ -24,6 +24,8 @@ * * @author Nikolaos Trogkanis */ +goog.provide('i18n.phonenumbers.PhoneNumberUtilTest'); +goog.setTestOnly(); goog.require('goog.array'); goog.require('goog.string.StringBuffer'); diff --git a/javascript/i18n/phonenumbers/shortnumberinfo_test.js b/javascript/i18n/phonenumbers/shortnumberinfo_test.js index 855528d15..b1b300ec3 100644 --- a/javascript/i18n/phonenumbers/shortnumberinfo_test.js +++ b/javascript/i18n/phonenumbers/shortnumberinfo_test.js @@ -25,6 +25,8 @@ * * @author James Wright */ +goog.provide('i18n.phonenumbers.ShotNumberInfoTest'); +goog.setTestOnly(); goog.require('goog.testing.jsunit'); goog.require('i18n.phonenumbers.PhoneNumber');