File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed
Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,6 @@ import org.jetbrains.kotlin.gradle.targets.jvm.KotlinJvmTarget
3030
3131
3232inline fun KotlinJvmTarget.configJava (jdkVersion : Int , crossinline block : KotlinJvmTarget .() -> Unit = {}) {
33- withJava()
3433 compilerOptions {
3534 javaParameters.set(true )
3635 jvmTarget.set(JvmTarget .fromTarget(jdkVersion.toString()))
@@ -88,12 +87,15 @@ inline fun Project.configJavaCompileWithModule(
8887 targetCompatibility = jvmVersion
8988
9089 if (moduleName != null ) {
91- options.compilerArgumentProviders.add(
92- CommandLineArgumentProvider {
90+ options.compilerArgumentProviders.add(CommandLineArgumentProvider {
91+ val sourceSet = sourceSets.findByName(" main" ) ? : sourceSets.findByName(" jvmMain" )
92+ if (sourceSet != null ) {
9393 // Provide compiled Kotlin classes to javac – needed for Java/Kotlin mixed sources to work
94- listOf (" --patch-module" , " $moduleName =${sourceSets[" main" ].output.asPath} " )
94+ listOf (" --patch-module" , " $moduleName =${sourceSet.output.asPath} " )
95+ } else {
96+ emptyList()
9597 }
96- )
98+ } )
9799 }
98100
99101 block()
Original file line number Diff line number Diff line change 11# Thu Mar 21 17:22:56 CST 2024
22distributionBase =GRADLE_USER_HOME
33distributionPath =wrapper/dists
4- distributionUrl =https\://services.gradle.org/distributions/gradle-8.5 -bin.zip
4+ distributionUrl =https\://services.gradle.org/distributions/gradle-8.10.2 -bin.zip
55zipStoreBase =GRADLE_USER_HOME
66zipStorePath =wrapper/dists
You can’t perform that action at this time.
0 commit comments