Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kotlinTarget nd javaTarget managed in libs.versions.toml #22

Merged
merged 1 commit into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 15 additions & 13 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ plugins {
alias(libs.plugins.publish)
}

val javaTargetVersion = 17
val kotlinTargetVersion = KotlinVersion.KOTLIN_2_0
val jvmTargetVersion = JvmTarget.fromTarget("$javaTargetVersion")

val githubAccount = "xemantic"

val javaTarget = libs.versions.javaTarget.get()
val kotlinTarget = KotlinVersion.fromVersion(libs.versions.kotlinTarget.get())

val isReleaseBuild = !project.version.toString().endsWith("-SNAPSHOT")
val githubActor: String? by project
val githubToken: String? by project
Expand Down Expand Up @@ -72,26 +72,28 @@ subprojects {
// set up according to https://jakewharton.com/gradle-toolchains-are-rarely-a-good-idea/
withType<KotlinJvmCompile> {
compilerOptions {
apiVersion = kotlinTargetVersion
languageVersion = kotlinTargetVersion
jvmTarget = jvmTargetVersion
freeCompilerArgs.add("-Xjdk-release=$javaTargetVersion")
apiVersion = kotlinTarget
languageVersion = kotlinTarget
jvmTarget = JvmTarget.fromTarget(javaTarget)
freeCompilerArgs.add("-Xjdk-release=$javaTarget")
progressiveMode = true
}
}

withType<JavaCompile> {
options.release = javaTargetVersion
options.release = javaTarget.toInt()
}

}

if (project.name.startsWith(rootProject.name)) {

apply(plugin = "maven-publish")
apply(plugin = "java-library")
apply(plugin = "org.jetbrains.dokka")
apply(plugin = "signing")
apply {
plugin("maven-publish")
plugin("java-library")
plugin("org.jetbrains.dokka")
plugin("signing")
}

configure<JavaPluginExtension> {
withJavadocJar()
Expand Down
3 changes: 3 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
[versions]
kotlinTarget = "2.0"
javaTarget = "17"

kotlin = "2.0.20"
kotlinxCoroutines = "1.8.1"
kotest = "5.9.1"
Expand Down