gabrielfv
08/13/2020, 6:41 PMbuildSrc
. Using Kotlin along with the kotlin-dsl
for gradle i’ve been able to move pretty much everything except for the following excerpt:
android {
kotlinOptions {
jvmTarget = "1.8"
}
}
The kotlinOptions
isn’t visible from the extensions within buildSrc
sourceset, probably because I don’t implement the dsl? I’ve tried doing the following, but it didn’t work
target.tasks.withType(KotlinCompile::class.java).forEach { task ->
task.kotlinOptions.jvmTarget = "1.8"
}
Igor Brishkoski
08/13/2020, 7:07 PMIgor Brishkoski
08/13/2020, 7:08 PM(this as ExtensionAware).configure<KotlinJvmOptions> {
jvmTarget = "1.8"
}
Igor Brishkoski
08/13/2020, 7:08 PMwithGroovyBuilder {
"kotlinOptions" {
setProperty("jvmTarget", "1.8")
}
}
gabrielfv
08/13/2020, 8:29 PM