Example

An example MetaBuild script. This written in Kotlin, but a real-world script would be written in a scripting language, such as Feather, Groovy, or maybe a kotlin script???

I prefer Feather, because it is easy to make it self-contained, using a "library" statement to include the metadata.jar file.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val toolchain: Int = 11
Link copied to clipboard

Functions

Link copied to clipboard
fun build()
Link copied to clipboard

Builds build.gradle.kts for each Project, as well as a single gradle.properties file and a single settings.gradle.kts file.

Link copied to clipboard

If your project already contains a gradle wrapper, then this updates it to the default version of gradle. Otherwise, it adds the gradle wrapper (The command gradle must be on your path).

fun installGradle(version: String)

If your project already contains a gradle wrapper, then this updates it to the specified version of gradle. Otherwise, it adds the gradle wrapper (The command gradle must be on your path).

Link copied to clipboard
fun jvmArgs(args: String)

Command line arguments for the jvm used by gradle. Adds a property org.gradle.jvmargs to gradle.properties.

Link copied to clipboard

fun kotlinVersion(version: String)

Specifies which version of the Kotlin plugin to use by all projects. Note, if you prefer, you can set this on a per-project basis using Project.kotlinVersion.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun project(projectName: String): Project
Link copied to clipboard
fun property(name: String, value: String)

Adds a property to gradle.properties.

Link copied to clipboard
fun publish(group: String, version: String)

Stores meta-data used by Project.publishing.

Link copied to clipboard
fun repositories(vararg repositories: Repository)

fun repositories(repositories: List<Repository>)

Define which repositories to use for all projects.

Link copied to clipboard

Declare the root project.

Link copied to clipboard
fun subProject(projectName: String): Project

Declares a subproject.

Link copied to clipboard
fun toolChain(version: Int)

Sets the JVM toolChain version for all projects. If this is omitted, then defaultToolChain is used.