Adds the dsl/clojurescriptextension.adoc to the project allowing the user to configure builds.
For each dsl/clojurescriptbuild.adoc it sets default values and creates the following tasks.
Creates a tasks/clojurecompile.adoc task named compileClojureScript
(for main
build) or compile<Name>Clojure
(e.g. compileTestClojureScript
), with the following defaults:
-
task.destinationDir
isbuild.outputDir
-
task.source
isbuild.sourceRoots
-
task.classpath
isbuild.sourceRoots
plusbuild.classpath
-
task.options
isbuild.compiler
For each SourceSet, the clojurescript-base
plugin will create a dsl/clojurescriptbuild.adoc. In addition to the defaults above, the following will be configured:
settings.gradle build.gradle src/ <source set name>/ clojurescript/ # Adds this to what java-base provides java/ resources/
The build will use this src/<name>/clojurescript
directory as its source root.
The ClojureScript 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 {
clojurescript.srcDirs = ['src']
resources.srcDirs = ['resources']
}
} |
The ClojureScript classpath will include:
-
the source set’s
compileClasspath
configuration dependencies -
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 ClojureScript source to be considered the output, or you may want compiled JavaScript to be considered the output.
The clojurescript-base
plugin will include only the compiled JavaScript in the source set output, if you enable any build.aotNamespaces
. Otherwise, it will only include the ClojureScript sources.