This message was deleted.
# community-support
s
This message was deleted.
c
All that function is doing is taking the Provider input and building a formatted string - convert is as appropriate to Groovy. Parameter type and return value would be the same, the rest is syntax differences.
a
yup, that's what I'm trying to determine
it's called like this: implementation(plugin(libs.plugins.pluginname))
c
yes. create a
plugin
function with the same parameter type, logic, and return value.
a
yeah I have no idea how to do that, trying to find the API I would need to call and not finding anything
c
no API. just a one-line Groovy function.
a
which would be?
...
c
surely you have other Groovy functions as an example? Haven’t touched Groovy in years. A quick Google should give you the syntax.
a
thanks for the help Chris!
I'm here because I've tried looking for what it would be, as I stated
next time please let someone else respond who can actually help
thanks
c
dude, seriously, you can fill in the blanks with Google instead of dumping on folks trying to help. The first results in a Google search are:
Copy code
def methodName() { 
   //Method code 
}
…the rest is boilerplate equivalent to the Kotlin function.
We are not here to do all this for you.
a
not sure how trying to help is telling me to "google", but thanks anyway
c
I provided you guidance on how to approach this, context that it’s a straightforward Groovy function (you’d indicated extensive Groovy code elsewhere) - that should be sufficient to get you on your way. Most folks would take it from there.
p
Something like that might get you started:
Copy code
def plugin(Provider<PluginDependency> plugin) {
    plugin.map { "${it.pluginId}:${it.pluginId}.gradle.plugin:${it.version}"}
}