diff --git a/example-projects/advanced/project.clj b/example-projects/advanced/project.clj index 7fe656b7..74dc91d7 100644 --- a/example-projects/advanced/project.clj +++ b/example-projects/advanced/project.clj @@ -30,6 +30,7 @@ ; development/debugging, and one with many optimizations for ; production use. :crossovers [example.crossover] + :crossover-jar true :builds [ {:source-path "src-cljs" :jar true diff --git a/plugin/src/leiningen/cljsbuild.clj b/plugin/src/leiningen/cljsbuild.clj index 3b948c05..88b40b50 100644 --- a/plugin/src/leiningen/cljsbuild.clj +++ b/plugin/src/leiningen/cljsbuild.clj @@ -15,7 +15,6 @@ '[[cljsbuild "0.1.0"]]) (def repl-output-path ".lein-cljsbuild-repl") -(def crossover-path ".lein-cljsbuild-crossover") (def compiler-output-dir-base ".lein-cljsbuild-compiler-") (def default-global-options @@ -23,11 +22,9 @@ :repl-listen-port 9000 :test-commands {} :crossover-path "crossover-cljs" + :crossover-jar false :crossovers []}) -; TODO Add a :crossover-jar boolean option? -; TODO Write a "migrating from 0.0.x to 0.1.x" doc... :( - (def default-compiler-options {:output-to "main.js" :optimizations :whitespace @@ -35,6 +32,7 @@ (def default-build-options {:source-path "src-cljs" + :jar false :compiler default-compiler-options}) (def exit-success 0) @@ -122,7 +120,7 @@ (:compiler opts#))) '~builds))) -(defn- run-tests [project {:keys [test-commands builds]} args] +(defn- run-tests [project {:keys [test-commands crossover-path builds]} args] (when (> (count args) 1) (throw (Exception. "Only expected zero or one arguments."))) (let [selected-tests (if (empty? args) @@ -285,8 +283,12 @@ Available commands: (defn- get-filespecs "Returns a seq of filespecs for cljs dirs (as passed to leiningen.jar/write-jar)" [project] - (let [builds (extract-options project) - paths (map :source-path (filter :jar builds))] + (let [options (extract-options project) + builds (:builds options) + build-paths (map :source-path (filter :jar builds)) + paths (if (:crossover-jar options) + (conj build-paths (:crossover-path options)) + build-paths)] (mapcat path-filespecs paths))) (defn compile-hook [task & args] diff --git a/sample.project.clj b/sample.project.clj index b5cb5ddc..ba398c57 100644 --- a/sample.project.clj +++ b/sample.project.clj @@ -44,8 +44,9 @@ ; "Sharing Code Between Clojure and Clojurescript" section for more details. ; Defaults to the empty vector []. :crossovers [example.crossover] - ; TODO: Document :crossovers-jar once that's added. - ; :crossovers-jar true + ; TODO: Document :crossover-jar once that's added. + ; :crossover-jar true + ; :crossover-path true ; The :builds option should be set to a sequence of maps. Each ; map will be treated as a separate, independent, ClojureScript ; compiler configuration