ClojureCheck

Loads Clojure source to ensure valid code and (optionally) check for use of reflection.

Command-Line Arguments

None

Properties

Property Type Description

classpath

ConfigurableFileCollection

Classpath of the JVM

source

FileTree

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

namespaces

SetProperty<String>

Namespaces within source that should be checked

reflection

Property<String>

One of silent, warn, fail. Controls whether reflection causes warnings or failures

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('clojureCheck')
  classpath.from(configurations.other)
  source = project.filetree('src/other')
  namespaces.add('mygroup.myns')
  reflection = 'fail'
  forkOptions {
    jvmArgs = ['-Xmx4g']
  }
}
build.gradle.kts
val clojureCheck by tasks.existing {
  classpath.from(configurations.other)
  source = project.filetree("src/other")
  namespaces.add("mygroup.myns")
  reflection = "fail"
  forkOptions {
    jvmArgs = listOf("-Xmx4g")
  }
}