This message was deleted.
# community-support
s
This message was deleted.
1
p
Yes there is. The KGP plugin registers an extension named
kotlin
of type
KotlinJvmProjectExtension
h
Any idea how I might access it's
KotlinJvmOptions
configuration? I am attempting to move the code below from a build script configuration, via task lookup, into a conventional plugin. I can't easily see how I might be able to do this via the
KotlinJvmProjectExtension
Copy code
tasks.withType(KotlinCompile::class).configureEach {
   kotlinOptions {
      allWarningsAsErrors = true
      jvmTarget = JavaVersion.VERSION_11.toString()

      sourceCompatibility = JavaVersion.VERSION_11.toString()
      targetCompatibility = JavaVersion.VERSION_11.toString()

      freeCompilerArgs = freeCompilerArgs + "-Xexplicit-api=strict" + "-opt-in=kotlin.RequiresOptIn"
   }
}
p
Yeah configuring the extension is quite different than configuring the task.
It depends on the options. But from the top of my head something like
kotlin.target.compilations["main"]
will get you the compilation options for the main source set.
kotlin.target.compilations.configureEach {}
should work if you want to configure them all
h
That seems to be what I was looking for, thank you for the help!
j
out of curiosity : are you releasing your convention plugins or using includeBuild ?
h
At the moment I am using
includeBuild
, but may start releasing them to a private artifact repository later on
j
Thanks. I reverted the includeBuild because of the performance penalty our build incurred : the dependency resolution for all modules ended up being done single threaded. which aligns with the squad blog post and the documentation