Permalink
Browse files

Prepare for ClojureScript development

We will hand-port the CLJS version of the main tools.cli namespace, but
use lein-cljsbuild, lein-dalap, and clojurescript.test for testing both
CLJ and CLJS builds.

lein-dalap is a preprocessor like cljx, but has the advantage that
CLJS-only forms are hidden within #_(:cljs ) comment forms so that the
file may remain as valid Clojure.

This is only for local testing of the hand-crafted CLJS file, so I don't
believe this runs afoul of any of the contrib library guidelines.
  • Loading branch information...
1 parent dbcf61a commit a9fdd0205406de71e46e99c8dc1eb69da18bd552 @guns guns committed Dec 9, 2013
Showing with 25 additions and 1 deletion.
  1. +1 −0 .gitignore
  2. +8 −0 dalap_rules.clj
  3. +16 −1 project.clj
View
@@ -1,2 +1,3 @@
target
.lein-failures
+/src/test/clojure/cljs
View
@@ -0,0 +1,8 @@
+;; This file directs the generation of the CLJS test namespace. The main CLJ
+;; and CLJS clojure.tools.cli files are hand-crafted.
+;;
+;; http://birdseyesoftware.github.io/lein-dalap.docs/articles/getting_started.html#specifying_which_files_you_want_to_transform_to_cljs
+
+{["src/test/clojure/clojure/tools/cli_test.clj"
+ "src/test/clojure/cljs/tools/cli_test.cljs"]
+ []}
View
@@ -12,7 +12,22 @@
:1.3 {:dependencies [[org.clojure/clojure "1.3.0"]]}
:1.4 {:dependencies [[org.clojure/clojure "1.4.0"]]}
:1.5 {:dependencies [[org.clojure/clojure "1.5.1"]]}
- :1.6 {:dependencies [[org.clojure/clojure "1.6.0-master-SNAPSHOT"]]}}
+ :1.6 {:dependencies [[org.clojure/clojure "1.6.0-master-SNAPSHOT"]]}
+
+ ;; Local CLJS development; not in pom.xml
+ :dev {:dependencies [[org.clojure/clojurescript "0.0-2080"]]
+ :plugins [[lein-cljsbuild "1.0.0"]
+ [com.birdseye-sw/lein-dalap "0.1.1"]
+ [com.cemerick/clojurescript.test "0.2.1"]]
+ :cljsbuild {:builds [{:source-paths ["src/main/clojure/cljs"
+ "src/test/clojure/cljs"]
+ :compiler {:output-to "target/cli_test.js"
+ :optimizations :simple
+ :pretty-print true}}]
+ :test-commands {"phantomjs" ["phantomjs"
+ :runner
+ "target/cli_test.js"]}}}}
+
:aliases {"test-all" ["with-profile" "test,1.2:test,1.3:test,1.4:test,1.5:test,1.6" "test"]
"check-all" ["with-profile" "1.2:1.3:1.4:1.5:1.6" "check"]}
:min-lein-version "2.0.0")

0 comments on commit a9fdd02

Please sign in to comment.