James Hendry
01/12/2022, 9:23 PMreobfJar {
shadowJar
}
I can't figure out how to do this in kotlin. reobfJar is a task. I want the reobfJar task to also be run on the shadowJar too. (not sure quite how this works unfortunately)
The closest i've got i think is:
tasks.all {
println("Task $this, path ${this.path}")
if (this.path == ":reobfJar") {
println("I AM REOBFJAR!")
this.configure<net.minecraftforge.gradle.patcher.tasks.ReobfuscateJar> {
tasks.getByName("shadowJar")
}
}
}
I can't figure out how to get the reobfjar task without iterating, .getByPath doesn't seem to work.
But also this.configure seems to want an Extension instead of a task? No clue what im supposed to do here.Vampire
01/13/2022, 10:59 AMreobfJar {
shadowJar
}
does what you expect it does?
To me it looks as you just set up that during the configuration phase of reobfJar
the shadowJar
task is realized.
But nothing "is run on something else" or configured or connected.
From a quick look at the sources of that plugin I'd say they are not really Kotlin DSL friendly and what you want to achieve is probably
(extensions["reobf"] as NamedDomainObjectContainer<*>).create("shadowJar")