Is there a way to access properties of the plugins...
# gradle
m
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
Can't you use
apply(from = plugin)
in .kts?
m
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
yea, I don't control those plugins. So applying them in groovy is only option?
g
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
this plugin is not in gradle repo so I cannot use declarative plugins syntax
g
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
I see
thanks a lot
👍 1