I am trying to force Gradle to create jar my own way. I wrote my own Gradle task (separate class) to do this and now I want to replace the default jar
task with it, so that:
jar
taskjar
task - it depends on classes
task, the build
task uses it, etc.UP-TO-DATE
(just like the default jar
)I'm struggling to do this and I'm having a lot of trouble to achieve this. For example, I was unable to force the build
task to always use my new task.
I would really appreciate it if someone could support me with a short howto.
This should work:
jar {
// reset actions
actions = []
// add your action that performs the work based
// on the configuration (e.g. 'source') of this task
doLast { ... }
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With