diff --git a/build.gradle.kts b/build.gradle.kts index e91d92d..4fde755 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -40,18 +40,17 @@ dependencies { val kotlinVersion = "1.9.0" val junit = "5.10.1" + val slf4j = "2.0.11" val okhttp = "4.12.0" compileOnly("org.jetbrains:annotations:$annotations") - implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion") - compileOnly("io.javalin:javalin:$javalin") - implementation(platform("io.javalin:javalin-parent:$javalin")) //Javalin BOM + implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion") + implementation(platform("io.javalin:javalin-parent:$javalin")) //Javalin BOM implementation("org.eclipse.jetty.http2:http2-server") implementation("org.eclipse.jetty:jetty-alpn-conscrypt-server") implementation("org.eclipse.jetty:jetty-alpn-java-server") - implementation("io.github.hakky54:sslcontext-kickstart:$sslContextKickstart") implementation("io.github.hakky54:sslcontext-kickstart-for-jetty:$sslContextKickstart") implementation("io.github.hakky54:sslcontext-kickstart-for-pem:$sslContextKickstart") @@ -59,7 +58,7 @@ dependencies { testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$junit") testImplementation("org.junit.jupiter:junit-jupiter-api:$junit") testImplementation("io.javalin:javalin:$javalin") - testImplementation("org.slf4j:slf4j-simple:2.0.11") + testImplementation("org.slf4j:slf4j-simple:$slf4j") testImplementation("com.squareup.okhttp3:okhttp:$okhttp") testImplementation("com.squareup.okhttp3:okhttp-tls:$okhttp") @@ -146,6 +145,8 @@ nexusPublishing { } tasks.register("dokkaJavadocJar") { + group = "documentation" + description = "Generates a jar file containing the generated Javadoc API documentation." dependsOn(tasks.dokkaJavadoc) from(tasks.dokkaJavadoc.flatMap { it.outputDirectory }) archiveClassifier.set("javadoc") @@ -159,6 +160,13 @@ java { modularity.inferModulePath.set(true) } +tasks.compileJava { + options.compilerArgumentProviders.add(CommandLineArgumentProvider { + // Provide compiled Kotlin classes to javac – needed for Java/Kotlin mixed sources to work + listOf("--patch-module", "io.javalin.community.ssl=${sourceSets["main"].output.asPath}") + }) +} + kotlin { compilerOptions{ jvmTarget.set(JvmTarget.JVM_11) diff --git a/src/main/kotlin/module-info.java b/src/main/java/module-info.java similarity index 91% rename from src/main/kotlin/module-info.java rename to src/main/java/module-info.java index 25dbbdc..f4da4bc 100644 --- a/src/main/kotlin/module-info.java +++ b/src/main/java/module-info.java @@ -2,7 +2,7 @@ exports io.javalin.community.ssl; exports io.javalin.community.ssl.util; - requires io.javalin; + requires transitive io.javalin; requires org.eclipse.jetty.server; requires org.eclipse.jetty.alpn.server; requires org.eclipse.jetty.http2.server;