-
-
Notifications
You must be signed in to change notification settings - Fork 424
Description
I feel pretty dumb for converting my Gradle scripts to the Kotlin DSL because, despite writing my program in Kotlin, the Gradle DSL is entirely un-intuitive and has very little documentation, the whole thing has caused headaches with no benefit.
With that said, how would one use the ConfigureShadowRelocation task in a Kotlin DSL gradle script?
I currently have this working:
tasks {
named<ShadowJar>("shadowJar") {
...definition here...
}
}
tasks {
build {
dependsOn(shadowJar)
}
}
I tried:
tasks {
"relocateShadowJar"(ConfigureShadowRelocation::class) {
target = shadowJar.get()
prefix = "myprefix"
}
}
and
tasks {
named<ConfigureShadowRelocation>("configureShadowRelocation") {
target = shadowJar.get()
prefix = "myprefix"
}
}
but cannot create a valid dependency relationship:
tasks {
shadowJar {
dependsOn(configureShadowRelocation) <--- unresolved
dependsOn(relocateShadowJar) <--- unresolved
}
}
I'm not sure this will even work, I am able to create a single working JAR from 3 individual package components (thank you!). I wanted to relocate the 3 packages to keep them together and distinct from all of the 3rd party dependencies, but this caused ClassNotFoundExceptions, I am hoping to fix these with the ConfigureShadowRelocation plugin. In other words I want to change:
com
javax
aaa
bbb
ccc
net
org
to
com
javax
myprogram
|
|\_aaa
|\_bbb
\_ccc
net
org