<https://kotlinlang.org/docs/gradle-compiler-optio...
# gradle
e
https://kotlinlang.org/docs/gradle-compiler-options.html#how-to-define-options For the 3rd level, ie the compilation unit, shouldnt it be the
KotlinCompilation
ie users should configure
compilerOptions
within
kotlin.targets.[xxx].compilations.[yyy]
? Should KGP be directing users to configure tasks directly? Also if a task is the compilation unit then what is the use of the KotlinCompilation abstraction? Seems it should be removed or merged with the tasks.
t
it is slight mess in some way. Recently we've removed compiler options from Kotlin compilation in favor of using task linked to the compilation. Previously both
KotlinCompilation
and
KotlinCompilationTask
exposed the same instance of compiler options. This lead to some confusion
e
Okay, thats fine, I just wanted to know because previously I have avoided configuring tasks specifically in favor of KotlinCompilation and now it seems configuring the task directly is the recommended way. Does
KotlinCompilation
serve any utility then? Seems it should just be the task (via the common task abstraction)
t
you could reach related compilation task via
KotlinCompilation
👍🏾 1