groostav
11/05/2021, 7:27 PMerror in project :B
Cannot inline bytecode built with JVM target 11 into bytecode that is being built with JVM target 1.6. Please specify proper '-jvm-target' option
I have a ~simple gradle.build.kts with two projects (:A and :B, where B depends on A with a deps{compile(project(":A"))}
), and about 20 runtime deps.
1. under intelliJ i can verify that the output class files from :A
are in java 11 (bytecode v55)
2. when i omit my problem section and compile :B
without it, I get java 11 (bytecode v55) classes
I'm using
tasks.compileJava {
options.release.set(11)
sourceCompatibility = "11"
targetCompatibility = "11"
}
tasks.compileKotlin {
kotlinOptions.jvmTarget = "11"
sourceCompatibility = "11"
}
everywhere I can think.
help?ephemient
11/05/2021, 7:43 PMjava {
sourceCompatibility = "11"
targetCompatibility = "11"
}
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
kotlinOptions.jvmTarget = "11"
}
ephemient
11/05/2021, 7:44 PMtapchicoma
11/05/2021, 7:49 PM1.8
. Could you paste here output of running: ./gradlew :a:outgoingVariants
ephemient
11/05/2021, 7:53 PMtapchicoma
11/05/2021, 7:54 PMgroostav
11/05/2021, 8:01 PMgroostav
11/05/2021, 8:01 PMgroostav
11/05/2021, 8:02 PMtapchicoma
11/05/2021, 8:02 PMtapchicoma
11/05/2021, 8:03 PMephemient
11/05/2021, 8:04 PMgroostav
11/05/2021, 8:20 PMtasks.kotlinCompileTasks.configEach { ...
(as opposed to tasks.kotlinCompileCollection { ...
) solved the issuetapchicoma
11/05/2021, 8:21 PMgroostav
11/05/2021, 8:21 PMsomeCollectionOfTypeAs.forEach { it.configTypeA()
, is that not true?ephemient
11/05/2021, 8:22 PMjava
extension and not configuring an individual JavaCompile taskgroostav
11/05/2021, 8:23 PMjava { target = 11 }
instead of tasks.compileJava { target = 11
?ephemient
11/05/2021, 8:24 PMgroostav
11/05/2021, 8:24 PMephemient
11/05/2021, 8:24 PMephemient
11/05/2021, 8:24 PMtapchicoma
11/05/2021, 8:24 PMtapchicoma
11/05/2021, 8:25 PMin the future it'll be possible to configure Kotlin similarlyMost probably from Kotlin 1.7 😉
ephemient
11/05/2021, 8:26 PMephemient
11/05/2021, 8:26 PMgroostav
11/05/2021, 8:49 PMno it's not, not in Groovy DSL nor Kotlin DSL does configuring one task affect otherssorry, even though the type of
tasks.withType<S>()
is TaskCollection<S>
, you mean to say that
TaskCollection<S>.invoke(config: S.() -> Unit)
does not do the same thing as
TaskCollection<S>.configureEach(config: S.() -> Unit)
?groostav
11/05/2021, 8:54 PMgroostav
11/05/2021, 8:58 PMgradle -q :api:dependencies
groostav
11/05/2021, 9:04 PMephemient
11/05/2021, 9:07 PMgroostav
11/05/2021, 9:13 PMephemient
11/06/2021, 6:59 AMephemient
11/06/2021, 7:00 AM