https://kotlinlang.org logo
Title
m

Matej Drobnič

08/07/2019, 6:43 AM
Is there a way to access properties of the plugins that do NOT support declaractive plugin syntax (e.g. only support
apply from
syntax) in kts gradle script? Currently I'm doing a hack by putting all properties of this plugin into regular non-kts gradle file and then applying that file, but it's ugly.
m

molikuner

08/07/2019, 6:48 AM
Can't you use
apply(from = plugin)
in .kts?
m

Matej Drobnič

08/07/2019, 6:53 AM
Yes I can
but I cannot access any custom plugin properties
since they are not in the kts classpath when compiling
briefly: it’s recommended to use buildSrc and precompiled script plugins instead of dynamic scripts
Or, if you don’t plan to rewrite those scripts, you still can apply dynamic groovy scripts in Kotlin
m

Matej Drobnič

08/07/2019, 6:59 AM
yea, I don't control those plugins. So applying them in groovy is only option?
g

gildor

08/07/2019, 7:23 AM
What kind plugins?
I’m talking only about
apply from
Could show an example of such plugin and what exactly you trying to do
m

Matej Drobnič

08/07/2019, 7:36 AM
this plugin is not in gradle repo so I cannot use declarative plugins syntax
g

gildor

08/07/2019, 7:42 AM
you can
and even without this you still can configure plugin without static accessors using this API https://docs.gradle.org/current/userguide/kotlin_dsl.html#sec:kotlin_using_standard_api
If you use Kotlin DSL I very recommend to read both documents, they are very well written and explain most of things that you may be needed
m

Matej Drobnič

08/07/2019, 7:52 AM
I see
thanks a lot
👍 1