From 461d19a7d71e80a0187255932d980f96d757a343 Mon Sep 17 00:00:00 2001 From: Evan Mezeske Date: Mon, 20 Feb 2012 02:16:00 -0700 Subject: [PATCH] Add some more documentation TODOs. --- README.md | 28 +++++++++++++++++++++++----- sample.project.clj | 16 +++++++++++----- 2 files changed, 34 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index f4db7e80..b96f82c8 100644 --- a/README.md +++ b/README.md @@ -97,22 +97,34 @@ automatically generated during compilation, run: ## Hooks -If you'd like your ClojureScript to be compiled when you run `lein compile`, and -deleted when you run `lein clean`, add the following entry to your project -configuration: +Some common lein-cljsbuild tasks can hook into the main Leiningen tasks +to enable ClojureScript support in each of them. The following tasks are +supported: + + $ lein compile + $ lein clean + $ lein test + $ lein jar + +To enable ClojureScript support for these tasks, add the following entry to +your project configuration: ```clj :hooks [leiningen.cljsbuild] ``` Note that this is also required for lein-cljsbuild to hook into the `lein jar` -task. For that to work, you will also need to explicitly enable the `jar` hook -by adding the following entry to your :cljsbuild configuration map: +Note that by default the `lein jar` task does *not* package your ClojureScript +code in the JAR file. This feature needs to be explicitly enabled by adding +the following entry to each of the `:builds` that you want included in the +JAR file. ```clj :jar true ``` +**TODO: Document :crossovers-jar once that's added.** + ## Multiple Build Configurations If the `:builds` sequence contains more than one map lein-cljsbuild @@ -145,6 +157,12 @@ of ways. See the [REPL documentation] (https://github.com/emezeske/lein-cljsbuild/blob/0.1.0/doc/REPL.md) for more details. +## Testing Support + +Lein-cljsbuild has built-in support for running ClojureScript tests. See the +[testing documentation] (https://github.com/emezeske/lein-cljsbuild/blob/0.1.0/doc/TESTING.md) +for more details. + # Sharing Code Between Clojure and ClojureScript Sharing code with lein-cljsbuild is accomplished via the configuration diff --git a/sample.project.clj b/sample.project.clj index f4097550..b5cb5ddc 100644 --- a/sample.project.clj +++ b/sample.project.clj @@ -35,6 +35,17 @@ "firefox-naked" ["firefox" "resources/public/html/naked.html"] "phantom" ["phantomjs" "phantom/page-repl.js"] "phantom-naked" ["phantomjs" "phantom/page-repl.js" "resources/public/html/naked.html"]} + ; TODO: Document + :test-commands + {"unit" ["phantomjs" "phantom/unit-test.js" "resources/private/html/unit-test.html"]} + ; TODO Fix the below description. + ; A list of namespaces that should be copied from the Clojure :source-path + ; into the ClojureScript :source-path. See the README file's + ; "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 ; The :builds option should be set to a sequence of maps. Each ; map will be treated as a separate, independent, ClojureScript ; compiler configuration @@ -42,11 +53,6 @@ ; The path under which lein-cljsbuild will look for ClojureScript ; files to compile. Defaults to "src-cljs". :source-path "src-cljs" - ; A list of namespaces that should be copied from the Clojure :source-path - ; into the ClojureScript :source-path. See the README file's - ; "Sharing Code Between Clojure and Clojurescript" section for more details. - ; Defaults to the empty vector []. - :crossovers [example.crossover] ; Set this key to make lein-cljsbuild hook into the "lein jar" task, and ; add the ClojureScript files to the jar that is created. :jar true