migrate docker-compose convention plugin out of buildSrc
This commit is contained in:
parent
105555bf6c
commit
f804c39a3b
32 changed files with 564 additions and 239 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import org.gradle.kotlin.dsl.support.expectedKotlinDslPluginsVersion
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
plugins {
|
||||
|
|
@ -11,6 +12,10 @@ dependencies {
|
|||
// This project should only be providing simple plugins for configuring Gradle without
|
||||
// dependencies. Try to avoid setting dependencies here, else the Gradle script classpath might
|
||||
// get polluted and messy.
|
||||
|
||||
implementation("org.gradle.kotlin:gradle-kotlin-dsl-plugins:$expectedKotlinDslPluginsVersion")
|
||||
// implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:${embeddedKotlinVersion}")
|
||||
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:${libs.versions.kotlin.get()}")
|
||||
}
|
||||
|
||||
kotlin {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,30 @@
|
|||
package kafkatorio.conventions
|
||||
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
plugins {
|
||||
id("org.gradle.kotlin.kotlin-dsl")
|
||||
kotlin("jvm")
|
||||
}
|
||||
|
||||
val gradleJvmTarget = 11
|
||||
|
||||
//kotlin {
|
||||
// jvmToolchain(gradleJvmTarget)
|
||||
//}
|
||||
|
||||
kotlin {
|
||||
jvmToolchain {
|
||||
(this as JavaToolchainSpec).languageVersion.set(JavaLanguageVersion.of(gradleJvmTarget))
|
||||
}
|
||||
}
|
||||
|
||||
kotlinDslPluginOptions {
|
||||
jvmTarget.set("$gradleJvmTarget")
|
||||
}
|
||||
|
||||
tasks.withType<KotlinCompile>().configureEach {
|
||||
kotlinOptions {
|
||||
jvmTarget = "$gradleJvmTarget"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
package kafkatorio.conventions
|
||||
|
||||
import org.gradle.api.Project
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
import org.gradle.jvm.toolchain.JavaLanguageVersion
|
||||
import org.gradle.jvm.toolchain.JavaToolchainSpec
|
||||
import org.gradle.kotlin.dsl.plugins.dsl.*
|
||||
import org.gradle.kotlin.dsl.withType
|
||||
|
||||
fun Project.overrideKotlinLanguageVersion(
|
||||
gradleKotlinTarget: String = "1.6"
|
||||
) {
|
||||
afterEvaluate {
|
||||
tasks.withType<KotlinCompile>().configureEach {
|
||||
kotlinOptions {
|
||||
apiVersion = gradleKotlinTarget
|
||||
languageVersion = gradleKotlinTarget
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue