Skip to content

Commit

Permalink
chore: Update build script
Browse files Browse the repository at this point in the history
  • Loading branch information
squid233 committed Dec 7, 2024
1 parent 6af8065 commit a0a0f3f
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 17 deletions.
6 changes: 3 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ plugins {
signing
}

val projGroupId: String by project
val projVersion: String by project
val projLicenseYear: String by project
val projGroupId: String by rootProject
val projVersion: String by rootProject
val projLicenseYear: String by rootProject

val jdkVersion: String by rootProject
val jdkEnablePreview: String by rootProject
Expand Down
7 changes: 7 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins { `kotlin-dsl` }

val kotlinPluginVersion: String by rootProject
val kotlinTargetJdkVersion: String by rootProject

repositories {
mavenCentral()
Expand All @@ -9,3 +10,9 @@ repositories {
dependencies {
implementation("org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:$kotlinPluginVersion")
}

kotlin {
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(kotlinTargetJdkVersion))
}
}
1 change: 1 addition & 0 deletions buildSrc/gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
kotlinPluginVersion=2.1.0
kotlinTargetJdkVersion=22
17 changes: 4 additions & 13 deletions buildSrc/src/main/kotlin/generator.conventions.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins { kotlin("jvm") }

val javaPoetVersion: String by rootProject
val jdkVersion: String by rootProject
val kotlinTargetJdkVersion: String by rootProject

repositories {
Expand All @@ -15,13 +11,8 @@ dependencies {
implementation("com.palantir.javapoet:javapoet:$javaPoetVersion")
}

tasks.withType<KotlinCompile> {
compilerOptions { jvmTarget.set(JvmTarget.fromTarget(kotlinTargetJdkVersion)) }
}

tasks.withType<JavaCompile> {
javaCompiler.set(javaToolchains.compilerFor {
targetCompatibility = kotlinTargetJdkVersion
languageVersion.set(JavaLanguageVersion.of(jdkVersion))
})
kotlin {
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(kotlinTargetJdkVersion))
}
}
2 changes: 1 addition & 1 deletion modules/overrungl.joml/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ overrunglModule {
publishInfo = Artifact.JOML
}

val jomlVersion: String by project
val jomlVersion: String by rootProject

dependencies {
api("org.joml:joml:$jomlVersion")
Expand Down

0 comments on commit a0a0f3f

Please sign in to comment.