com.autonomousapps.kit.gradle.Plugin.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gradle-testkit-support Show documentation
Show all versions of gradle-testkit-support Show documentation
A DSL for building test fixtures with Gradle TestKit
package com.autonomousapps.kit.gradle
import com.autonomousapps.kit.render.Element
import com.autonomousapps.kit.render.Scribe
public class Plugin @JvmOverloads constructor(
public val id: String,
public val version: String? = null,
public val apply: Boolean = true,
) : Element.Line {
override fun render(scribe: Scribe): String = scribe.line { s ->
s.append("id ")
s.appendQuoted(id)
version?.let { v ->
s.append(" version ")
s.appendQuoted(v)
}
if (!apply) {
s.append(" apply false")
}
}
public companion object {
@JvmOverloads
@JvmStatic
public fun of(
id: String,
version: String? = null,
apply: Boolean = true,
): Plugin = Plugin(id, version, apply)
/*
* Gradle core plugins.
*/
@JvmStatic public val antlr: Plugin = Plugin("antlr")
@JvmStatic public val application: Plugin = Plugin("application")
@JvmStatic public val groovy: Plugin = Plugin("groovy")
@JvmStatic public val groovyGradle: Plugin = Plugin("groovy-gradle-plugin")
@JvmStatic public val java: Plugin = Plugin("java")
@JvmStatic public val javaGradle: Plugin = Plugin("java-gradle-plugin")
@JvmStatic public val javaLibrary: Plugin = Plugin("java-library")
@JvmStatic public val javaTestFixtures: Plugin = Plugin("java-test-fixtures")
@JvmStatic public val scala: Plugin = Plugin("scala")
@JvmStatic public val war: Plugin = Plugin("war")
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy