Is there any practical reason for the syntax ```we...
# gradle
n
Is there any practical reason for the syntax
Copy code
webpackTask(
    Action {
        ...
    }
)
instead of the (now deprecated) simpler, more readable, shorter, less verbose, ... :)
Copy code
webpackTask { 
    ...                
}
Thanks.
h
In gradle build scripts, you can safely ignore the message, because gradle generates a receiver function for each declared Action.
n
Very good news, thanks 🙂
e
Ideally that DSL should have exposed only Action from the start. Kotlin does this thing where they expose both an Action & a lambda fro some APIs but its completely redundant, because in kotlin build scripts, SamWithReceiver makes it such that you can call the Action overload like its a lambda. If the argument is that it looks better for plugin authors that depend on KGP, then they can always enable just the sam with receiver plugin within their own plugin compilation, and get the exact same benefits. Again, completely redundant from KGP (and other plugin maintainers who do this)
🙏 1
👍🏻 1
v
Yeah, that's probably why they deprecated it. They cannot simply remove it as that would break binary compatibility with other plugins calling it. But at soon as the deprecated one is removed, the
Action
one is used automatically with the sam-with-receiver plugin. That's why you can ignore the deprecation warning when using it from build scripts.
👍🏻 1
🙏 1
1