Adds the dsl/clojureextension.adoc to the project allowing the user to configure builds.
For each dsl/clojurebuild.adoc it sets default values and creates the following tasks.
Creates a tasks/clojurecheck.adoc task named checkClojure
(for main
build) or check<Name>Clojure
(e.g. checkTestClojure
), with the following defaults:
-
task.source
isbuild.sourceRoots
-
task.classpath
isbuild.sourceRoots
plusbuild.classpath
-
task.reflection
isbuild.reflection
-
task.namespaces
isbuild.checkNamespaces
Creates a tasks/clojurecompile.adoc task named compileClojure
(for main
build) or compile<Name>Clojure
(e.g. compileTestClojure
), with the following defaults:
-
task.destinationDir
isbuild.outputDir
-
task.source
isbuild.sourceRoots
-
task.classpath
isbuild.sourceRoots
plusbuild.classpath
-
task.options
isbuild.compiler
-
task.namespaces
isbuild.aotNamespaces
For each SourceSet, the clojure-base
plugin will create a dsl/clojurebuild.adoc. In addition to the defaults above, the following will be configured:
settings.gradle build.gradle src/ <source set name>/ clojure/ # Adds this to what java-base provides java/ resources/
The build will use this src/<name>/clojure
directory as its source root.
The Clojure source directories will also be registed with the source set’s allSource
and allJava
, making them discoverable to other Gradle plugins.
Tip
|
For maximum compatibility, if you want to modify your source layout, configure on the source set, rather than the build. build.gradle
sourceSets {
main {
clojure.srcDirs = ['src']
resources.srcDirs = ['resources']
}
} |
The Clojure classpath will include:
-
the source set’s
compileClasspath
configuration dependencies -
the source set’s compiled Java classes
-
the source set’s processed resources
Each source set has a concept of its output directories and the tasks needed to populate them. Depending on your use case, you may want the Clojure source to be considered the output, or you may want AOT classes to be considered the output.
The clojure-base
plugin will include only the AOT classes in the source set output, if you enable any build.aotNamespaces
. Otherwise, it will only include the Clojure sources.