Expose statically-typed kotlinOptions and compileKotlinTask in DSL

To simplify configuring a `KotlinCompilation` with Gradle Kotlin DSL, it
is essential to expose statically-known types where possible.

This commit parametrizes `KotlinCompilation` with its Kotlin options
type (a subtype of `KotlinCommonOptions`) and adds `kotlinOptions` and
`compileKotlinTask` to `KotlinCompilation`.

(minor) Also reduce the visibility of `attachClassesDir` and
`setupPlugins` to internal, since this API is not for external use.
This commit is contained in:
Sergey Igushkin
2018-11-12 17:02:36 +03:00
parent 1e2436b1c1
commit 581b161611
27 changed files with 157 additions and 114 deletions
@@ -32,7 +32,7 @@ class ExampleSubplugin : KotlinGradleSubplugin<AbstractCompile> {
javaCompile: AbstractCompile?,
variantData: Any?,
androidProjectHandler: Any?,
kotlinCompilation: KotlinCompilation?
kotlinCompilation: KotlinCompilation<*>?
): List<SubpluginOption> {
println("ExampleSubplugin loaded")
return listOf(SubpluginOption("exampleKey", "exampleValue"))