Skip to content

Commit

Permalink
Add some more documentation TODOs.
Browse files Browse the repository at this point in the history
  • Loading branch information
emezeske committed Feb 20, 2012
1 parent b704ade commit 461d19a
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 10 deletions.
28 changes: 23 additions & 5 deletions README.md
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
16 changes: 11 additions & 5 deletions sample.project.clj
Expand Up @@ -35,18 +35,24 @@
"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
:builds [{
; 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
Expand Down

0 comments on commit 461d19a

Please sign in to comment.