ClojureCompile

Compiles Clojure source to class files.

Command-Line Arguments

None

Properties

Property Type Description

destinationDir

DirectoryProperty

Directory the class files will be written to

classpath

ConfigurableFileCollection

Classpath of the JVM

source

FileTree

Tree of source files (roots must be included in classpath)

options

ClojureCompileOptions

Options provided to the Clojure compiler

namespaces

SetProperty<String>

Namespaces within source that should be checked

javaLauncher

Property<JavaLauncher>

Overrides the Java executable to use for the task’s JVM

forkOptions

ForkOptions

Configure JVM settings

Example

Besides JVM options, all other settings are better controlled in the ClojureBuild.

To configure a check task:

build.gradle
tasks.named('clojureCompile')
  destinationDir = project.layout.buildDirectory.dir('mytarget')
  classpath.from(configurations.other)
  source = project.filetree('src/other')
  namespaces.add('mygroup.myns')
  forkOptions {
    jvmArgs = ['-Xmx4g']
  }
  // options should be configured on the ClojureBuild
}
build.gradle.kts
val clojureCompile by tasks.existing {
  destinationDir = project.layout.buildDirectory.dir("mytarget")
  classpath.from(configurations.other)
  source = project.filetree("src/other")
  namespaces.add("mygroup.myns")
  forkOptions {
    jvmArgs = listOf("-Xmx4g")
  }
  // options should be configured on the ClojureBuild
}