This message was deleted.
# community-support
s
This message was deleted.
e
Copy code
myExtension {
  feature1 {
    // works fine!
  }

  compose {
    // doesn't call my method
  }
}
e
if you write your plugin and buildscripts in Kotlin, you won't have to deal with Groovy… but otherwise yes, you do have to avoid using Groovy names in places where they may interfere (
collect
is another annoyingly common name)
e
I don’t want try inflict kts files on the team for this, but ugh groovy.
Ok thanks, guess renaming the method is the way
v
A use-site workaround would probably be to call
delegate.compose { ... }
Actually with Groovy you can intercept and redirect or replace any method call, so you could probably hook in there and do what you want. But the question is whether you should. :-D
e
iiiinteresting. can you do this from the plugin or would it have to be in the build script. i know ~nothing about groovy, other than what i’ve picked up because of gradle.
e
build script is what Björn means by "use-site", e.g.
Copy code
myExtension {
  delegate.compose {
e
yeah i got the use site working, it’s just not a good ux. interested to hear if i can just replace/kill the
compose
method though. if nothing else it’s interesting to play with.
got the metaclass, but it doesn’t seem to have either a method or a metaMethod with the name
compose
. the plugin is in kotlin, so i can’t do
metaclass.compose = { … }
like what i’m finding on stackoverflow
e
e
oh, good call. it’s part of closure…
v
Hm, I had a quick look and it seems for closures it is indeed not that easy, as they are also not
Closure
instances but instances of a dynamic subclass and you cannot easily get or set a meta class for those. So it probably indeed seems to be best to either rename the method or at least change its signature, for example to
compose(true) { ... }
or
compose(null) { ... }
or whatever
e
haha ok i played around with this stuff for a while and couldn’t get it working either. glad to hear someone who actually knows what they’re doing couldn’t get it either.
thank you both for the replies. this community is great cause of people like you ❤️
👌 1