Skip to content

Commit 2b948b0

Browse files
committed
bump tools reader and Google Closure Compiler dependencies
charset API changed in GCC, fix cljs.closure/set-options
1 parent b98351e commit 2b948b0

File tree

4 files changed

+24
-7
lines changed

4 files changed

+24
-7
lines changed

pom.template.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<dependency>
3131
<groupId>com.google.javascript</groupId>
3232
<artifactId>closure-compiler</artifactId>
33-
<version>v20151216</version>
33+
<version>v20160125</version>
3434
</dependency>
3535
<dependency>
3636
<groupId>org.clojure</groupId>
@@ -50,7 +50,7 @@
5050
<dependency>
5151
<groupId>org.clojure</groupId>
5252
<artifactId>tools.reader</artifactId>
53-
<version>1.0.0-alpha1</version>
53+
<version>1.0.0-alpha3</version>
5454
</dependency>
5555
</dependencies>
5656

project.clj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
:test-paths ["src/test/clojure" "src/test/cljs" "src/test/self"]
1111
:dependencies [[org.clojure/clojure "1.7.0"]
1212
[org.clojure/data.json "0.2.6"]
13-
[org.clojure/tools.reader "1.0.0-alpha1"]
13+
[org.clojure/tools.reader "1.0.0-alpha3"]
1414
[org.clojure/google-closure-library "0.0-20151016-61277aea"]
15-
[com.google.javascript/closure-compiler "v20151216"]
15+
[com.google.javascript/closure-compiler "v20160125"]
1616
[org.mozilla/rhino "1.7R5"]]
1717
:profiles {:1.6 {:dependencies [[org.clojure/clojure "1.6.0"]]}
1818
:uberjar {:aot :all :main clojure.main}}

script/bootstrap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
set -e
44

55
CLOJURE_RELEASE="1.8.0"
6-
CLOSURE_RELEASE="20151216"
6+
CLOSURE_RELEASE="20160125"
77
DJSON_RELEASE="0.2.6"
88
GCLOSURE_LIB_RELEASE="0.0-20151016-61277aea"
99
RHINO_RELEASE="1_7R5"
10-
TREADER_RELEASE="1.0.0-alpha1"
10+
TREADER_RELEASE="1.0.0-alpha3"
1111

1212
# check dependencies
1313
curl -V >/dev/null || { echo "cURL is missing, or not on your system path."; exit 1; }

src/main/clojure/cljs/closure.clj

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
[javax.xml.bind DatatypeConverter]
6565
[java.nio.file Path Paths Files StandardWatchEventKinds WatchKey
6666
WatchEvent FileVisitor FileVisitResult]
67+
[java.nio.charset Charset StandardCharsets]
6768
[com.sun.nio.file SensitivityWatchEventModifier]
6869
[com.google.common.base Throwables]))
6970

@@ -169,6 +170,22 @@
169170
:pretty-print :print-input-delimiter :pseudo-names :recompile-dependents :source-map
170171
:source-map-inline :source-map-timestamp :static-fns :target :verbose :warnings})
171172

173+
(def string->charset
174+
{"iso-8859-1" StandardCharsets/ISO_8859_1
175+
"us-ascii" StandardCharsets/US_ASCII
176+
"utf-16" StandardCharsets/UTF_16
177+
"utf-16be" StandardCharsets/UTF_16BE
178+
"utf-16le" StandardCharsets/UTF_16LE
179+
"utf-8" StandardCharsets/UTF_8})
180+
181+
(defn to-charset [charset]
182+
(cond
183+
(instance? Charset charset) charset
184+
(string? charset) (get string->charset (string/lower-case charset))
185+
:else
186+
(throw
187+
(ex-info (str "Invalid :closure-output-charset " charset) {}))))
188+
172189
(defn set-options
173190
"TODO: Add any other options that we would like to support."
174191
[opts ^CompilerOptions compiler-options]
@@ -221,7 +238,7 @@
221238
(setExtraAnnotationNames (map name (:closure-extra-annotations opts)))))
222239

223240
(. compiler-options
224-
(setOutputCharset (:closure-output-charset opts "UTF-8")))
241+
(setOutputCharset (to-charset (:closure-output-charset opts "UTF-8"))))
225242

226243
compiler-options)
227244

0 commit comments

Comments
 (0)