dev.clojurephant.clojure
Base Clojure Support
Applies the dev.clojurephant.clojure-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/
clojure/
java/
resources/
test/
clojure/
java/
resources/
dev/
clojure/
java/
resources/
Main Source
By default the main build runs with build.checkAll(). This will let you know if any of your code is invalid and would fail a compile (without producing AOT classes).
Test Source
By default the test build runs with build.aotAll() since the only reliable way to run Clojure tests via Gradle’s native Test task is to have them pre-compiled into class files.
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.