ClojureExtension

Entry point to the DSL for configuring Clojure builds.

Properties

Property Type Description

rootOutputDir

DirectoryProperty

Root directory builds output dirs will conventionally be children of

builds

NamedDomainObjectContainer<ClojureBuild>

Container of all builds for this project

Methods

Method Description

void builds(Action<? super NamedDomainObjectContainer<ClojureBuild>> action)

Allows configuring the builds in a block

Example

If JVM options must be set, configure the respective task’s forkOptions.
build.gradle
clojure {
  builds {
    // Defaults noted here are for custom builds, the convention plugin configures the builds it adds differently
    mybuild {
     sourceRoots.from("src/somewhere") // no default

     // Configuration of the check<Build>Clojure task
     checkNamespaces = ['my.core', 'my.base'] // defaults to no namespaces checked
     checkNamespaces.add('my-core') // just add a single namespace
     checkAll() // checks any namespaces found in the source set
     reflection = 'fail' // defaults to 'silent', can also be 'warn'

     // Configuration of the compile<Build>Clojure task
     aotNamespaces = ['my.core', 'my.base'] // defaults to no namespaces aoted
     aotNamespaces.add('my-core') // just add a single namespace
     aotAll() // aots any namespaces found in the source set
     compiler {
       disableLocalsClearing = true // defaults to false
       elideMeta = ['doc', 'file'] // defaults to empty list
       directLinking = true // defaults to false
     }
    }
  }
}
build.gradle.kts
clojure {
  builds {
    // Defaults noted here are for custom builds, the convention plugin configures the builds it adds differently
    val mybuild by creating {
     sourceRoots.from("src/somewhere") // no default

     // Configuration of the check<Build>Clojure task
     checkNamespaces = listOf("my.core", "my.base") // defaults to no namespaces checked
     checkNamespaces.add("my-core") // just add a single namespace
     checkAll() // checks any namespaces found in the source set
     reflection = "fail" // defaults to 'silent', can also be 'warn'

     // Configuration of the compile<Build>Clojure task
     aotNamespaces = listOf("my.core", "my.base") // defaults to no namespaces aoted
     aotNamespaces.add("my-core") // just add a single namespace
     aotAll() // aots any namespaces found in the source set
     compiler {
       disableLocalsClearing = true // defaults to false
       elideMeta = listOf("doc", "file") // defaults to empty list
       directLinking = true // defaults to false
     }
    }
  }
}