'Tasks with type gradle Kotlin script convert from Groovy (shadow plugin)

I tried to convert the Groovy script from shadow plugin's guide

task relocateShadowJar(type: ConfigureShadowRelocation) {
    target = tasks.shadowJar
}
tasks.shadowJar.dependsOn tasks.relocateShadowJar

with something like

tasks.register("relocateShadowJar") {
    com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation(tasks.shadowJar)
}

But it says "too many argument" at tasks.shadowJar. I assumed it needs to be initialized or something like that? How do I convert this? please help me, thank you in advance



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source