Alex Schiff
10/01/2024, 12:47 PMJavaCompile
to KotlinCompile
or equivalent?
task compileStubs(type: JavaCompile) {
JavaCompile compileJava = project.getTasksByName("compileJava", true).toArray()[0]
classpath = compileJava.classpath
source = project.getLayout().getBuildDirectory().dir("generated-stub-sources")
def stubsClassesDir = file("${project.getBuildDir()}/generated-stub-classes")
destinationDir(stubsClassesDir)
compileJava.finalizedBy(compileStubs)
}
Alex Schiff
10/01/2024, 12:48 PMephemient
10/01/2024, 4:12 PMAlex Schiff
10/01/2024, 4:23 PMephemient
10/01/2024, 4:41 PMAlex Schiff
10/01/2024, 4:43 PMephemient
10/01/2024, 4:43 PMAlex Schiff
10/01/2024, 4:49 PMAlex Schiff
10/01/2024, 4:50 PMephemient
10/01/2024, 6:01 PMval wiremocksSourceSet = sourceSets.create("wiremocks") {
java.srcDir(layout.buildDirectory.dir("generated-stub-sources"))
}
java.registerFeature("wiremocks") {
usingSourceSet(wiremocksSourceSet)
}
will create a ${project.name}-wiremocks.jar
and add it to the publication, and since it goes through the usual sourceset registration, Kotlin worksAlex Schiff
10/01/2024, 7:16 PM