Skip to content

Commit

Permalink
Simplify module compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
Sineaggi committed Jun 3, 2024
1 parent d9363fd commit ad45ec6
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions okio/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,10 @@ kotlin {

val java9 by sourceSets.creating {
java.srcDir("src/jvmMain/java9")
compileClasspath = objects.fileCollection()
.from(configurations.named("jvmCompileClasspath"))
}

configurations.named("java9CompileClasspath") {
extendsFrom(configurations["jvmCompileClasspath"])
}

testing {
Expand All @@ -220,14 +222,10 @@ testing {

tasks {
val compileJava9Java by getting(JavaCompile::class) {
val compileKotlinJvm = named<KotlinCompile>("compileKotlinJvm")
.flatMap { it.destinationDirectory }.map { it.asFile.absolutePath }
inputs.dir(compileKotlinJvm)
options.compilerArgumentProviders.plusAssign(
CommandLineArgumentProvider {
listOf("--patch-module", "okio=${compileKotlinJvm.get()}")
},
)
dependsOn("compileKotlinJvm")
options.compilerArgumentProviders.add(CommandLineArgumentProvider {
listOf("--patch-module", "okio=${sourceSets["main"].output.asPath}")
})
options.release = 9
}

Expand Down

0 comments on commit ad45ec6

Please sign in to comment.