Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Build scripts use cljs.closure/build

  • Loading branch information...
commit 82c576266e4594ae02be17f34e764ada4c001c11 1 parent e83385c
@brentonashworth brentonashworth authored
Showing with 17 additions and 13 deletions.
  1. +5 −11 bin/cljsc
  2. +12 −2 bin/cljsc.clj
16 bin/cljsc
@@ -1,12 +1,7 @@
-# Compile all cljs files into a single JavaScript file. Takes one or
-# two arguments followed by any number of gclosure compiler arguments.
-# The first argument is the directory containing the cljs sources to
-# compile. It is required. An optional second argument specifies the
-# name of the output directory where js files will be created. core.js
-# and all closure library dependencies used by core.js are included by
-# default (see cljsc.clj).
+# Compile a single cljs file or a directory of cljs files into a
+# single JavaScript file.
for next in lib/*: closure/compiler/*: src/clj: src/cljs; do
@@ -15,13 +10,12 @@ done
if test $# -eq 0
- echo "Usage: cljsc <root-dir>"
- echo " cljsc <root-dir> <js-output-dir>"
- echo " cljsc <root-dir> <js-output-dir> <gclosure-args>"
+ echo "Usage: cljsc <file-or-dir>"
+ echo " cljsc <file-or-dir> {:optimizations :advanced}"
java -server -Xmx2G -Xms2G -Xmn256m \
-cp $CLJSC_CP \
- clojure.main $CLOJURESCRIPT_HOME/bin/cljsc.clj $CLOJURESCRIPT_HOME $*
+ clojure.main $CLOJURESCRIPT_HOME/bin/cljsc.clj $*
14 bin/cljsc.clj
@@ -6,6 +6,16 @@
; the terms of this license.
; You must not remove this notice, or any other, from this software.
-(require '[cljs.project-compiler :as comp])
+(require '[cljs.closure :as closure])
-(apply comp/compile-project *command-line-args*)
+(defn transform-cl-args
+ [args]
+ (let [source (first args)
+ opts-string (apply str (interpose " " (rest args)))
+ options (when (> (count opts-string) 1)
+ (try (read-string opts-string)
+ (catch Exception e (println e))))]
+ {:source source :options (merge {:output-to :print} options)}))
+(let [args (transform-cl-args *command-line-args*)]
+ (closure/build (:source args) (:options args)))

0 comments on commit 82c5762

Please sign in to comment.
Something went wrong with that request. Please try again.