dev.clojurephant.clojurescript
Base ClojureScript Support
Applies the dev.clojurephant.clojurescript-base plugin.
Java Support
Applies the Gradle built-in java plugin to get convention-based support for the JVM ecosystem.
The high-level features of the java plugin are:
-
Creating a
mainsource set for your production code -
Creating a
jartask that packages themainsource set’s output -
Creating a
testsource set for use with JUnit testing-
The
testsource set depends on themainsource set’s output (i.e. Java classes) -
Creates a
testtask to execute the tests
-
Full Project Layout
settings.gradle
build.gradle
src/
main/
clojurescript/
java/
resources/
test/
clojurescript/
java/
resources/
dev/
clojurescript/
java/
resources/
Development Source
Its conventional in Clojure/ClojureScript projects to have a set of development-only source code, typically for use in a REPL environment.
The convention plugins create a new SourceSet named dev to house this code. The dev source sets’s dependency "buckets" extend from the test and main ones, avoiding the need to repeat declaring dependencies.
Compile Classpath
-
Clojure/ClojureScript source from the
testsource set -
Clojure/ClojureScript source from the
mainsource set -
Compiled Java classes from the
mainsource set -
the source set’s
compileClasspathconfiguration dependencies (which include the deps fromtestandmain)
Runtime (REPL) Classpath
-
Clojure/ClojureScript source from the
devsource set -
Clojure/ClojureScript source from the
testsource set -
Clojure/ClojureScript source from the
mainsource set -
Compiled Java classes from the
mainsource set -
the source set’s
compileClasspathconfiguration dependencies (which include the deps fromtestandmain) -
sourcesandjavadocJARs of all dependencies (where available) — this can be used by editor’s like CIDER to help with navigate to source or documentation -
nreplconfiguration dependencies (the nREPL server and any "jacked-in" dependencies)
REPL Task
Creates a ClojureNRepl task (named clojureRepl) to provide an nREPL server using the dev runtime classpath.