Skip to content

Commit ad45ec6

Browse files
committed
Simplify module compilation
1 parent d9363fd commit ad45ec6

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

okio/build.gradle.kts

+8-10
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,10 @@ kotlin {
196196

197197
val java9 by sourceSets.creating {
198198
java.srcDir("src/jvmMain/java9")
199-
compileClasspath = objects.fileCollection()
200-
.from(configurations.named("jvmCompileClasspath"))
199+
}
200+
201+
configurations.named("java9CompileClasspath") {
202+
extendsFrom(configurations["jvmCompileClasspath"])
201203
}
202204

203205
testing {
@@ -220,14 +222,10 @@ testing {
220222

221223
tasks {
222224
val compileJava9Java by getting(JavaCompile::class) {
223-
val compileKotlinJvm = named<KotlinCompile>("compileKotlinJvm")
224-
.flatMap { it.destinationDirectory }.map { it.asFile.absolutePath }
225-
inputs.dir(compileKotlinJvm)
226-
options.compilerArgumentProviders.plusAssign(
227-
CommandLineArgumentProvider {
228-
listOf("--patch-module", "okio=${compileKotlinJvm.get()}")
229-
},
230-
)
225+
dependsOn("compileKotlinJvm")
226+
options.compilerArgumentProviders.add(CommandLineArgumentProvider {
227+
listOf("--patch-module", "okio=${sourceSets["main"].output.asPath}")
228+
})
231229
options.release = 9
232230
}
233231

0 commit comments

Comments
 (0)