Skip to content

Commit 03e81b8

Browse files
committed
Use sourceSets
1 parent 8924329 commit 03e81b8

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

okio/build.gradle.kts

+8-6
Original file line numberDiff line numberDiff line change
@@ -189,26 +189,28 @@ kotlin {
189189
}
190190
}
191191

192+
val java9 by sourceSets.creating {
193+
java.srcDir("src/jvmMain/java9")
194+
compileClasspath = objects.fileCollection()
195+
.from(configurations.named("jvmCompileClasspath"))
196+
}
197+
192198
tasks {
193-
val compileModuleInfo by registering(JavaCompile::class) {
194-
classpath = objects.fileCollection()
195-
.from(configurations.named("jvmCompileClasspath"))
199+
val compileJava9Java by getting(JavaCompile::class) {
196200
val compileKotlinJvm = named<KotlinCompile>("compileKotlinJvm")
197201
dependsOn(compileKotlinJvm)
198202
options.compilerArgumentProviders.plusAssign(
199203
CommandLineArgumentProvider {
200204
listOf("--patch-module", "okio=${compileKotlinJvm.get().destinationDirectory.get().asFile.absolutePath}")
201205
},
202206
)
203-
destinationDirectory = layout.buildDirectory.dir("classes/java/moduleInfo")
204207
options.release = 9
205-
source(layout.projectDirectory.dir("src/jvmMain/java"))
206208
}
207209

208210
val jvmJar by getting(Jar::class) {
209211
// BundleTaskConvention() crashes unless there's a 'main' source set.
210212
sourceSets.create(SourceSet.MAIN_SOURCE_SET_NAME)
211-
from(compileModuleInfo) {
213+
from(compileJava9Java) {
212214
into("META-INF/versions/9")
213215
}
214216
val bndConvention = BundleTaskConvention(this)

okio/src/integrationTest/java/module-info.java

Whitespace-only changes.
File renamed without changes.

0 commit comments

Comments
 (0)