Updated build.gradle.kts

This commit is contained in:
Josh-Larson
2026-09-06 17:42:12 -05:00
parent fa2ec61743
commit e5a0e1deb7
+18 -11
View File
@@ -1,19 +1,20 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
plugins {
idea
`java-library`
kotlin("jvm")
}
val javaVersion: String by ext
val javaMajorVersion: String by ext
val kotlinTargetJdk: String by ext
val javaVersion = extra["javaVersion"] as JavaVersion
val kotlinTargetJdk = extra["kotlinTargetJdk"] as JvmTarget
java {
modularity.inferModulePath.set(true)
toolchain.languageVersion.set(JavaLanguageVersion.of(javaVersion.majorVersion))
}
idea {
targetVersion = javaVersion
module {
inheritOutputDirs = true
}
@@ -27,23 +28,29 @@ repositories {
sourceSets {
main {
dependencies {
implementation(group="org.jetbrains", name="annotations", version="20.1.0")
implementation("org.jetbrains:annotations:20.1.0")
implementation(project(":pswgcommon"))
api(group="me.joshlarson", name="jlcommon-network", version="1.1.2")
implementation(group="me.joshlarson", name="websocket", version="0.9.6")
api("me.joshlarson:jlcommon-network:1.1.2")
implementation("me.joshlarson:websocket:0.9.6")
}
}
test {
dependencies {
testImplementation(kotlin("stdlib"))
testImplementation(group="junit", name="junit", version="4.12")
testImplementation("junit:junit:4.12")
}
}
}
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
kotlinOptions {
jvmTarget = kotlinTargetJdk
compilerOptions {
jvmTarget.set(kotlinTargetJdk)
}
destinationDirectory.set(File(destinationDirectory.get().asFile.path.replace("kotlin", "java")))
}
// Make Kotlin classes visible while javac compiles the JPMS module descriptor.
tasks.named<JavaCompile>("compileJava") {
options.compilerArgumentProviders.add(CommandLineArgumentProvider {
listOf("--patch-module", "com.projectswg.forwarder=${sourceSets.main.get().output.asPath}")
})
}