mirror of
https://github.com/ProjectSWGCore/forwarder.git
synced 2026-09-11 23:44:59 -04:00
Updated build.gradle.kts
This commit is contained in:
+18
-11
@@ -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}")
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user