I\'m writing a custom gradle plugin to handle some vaguely complicated work and I have run into a frustrating problem while using properties to configure some of the tasks that
The answer by Peter in my question here indicates that conventionMapping feature will definitely go away. It's best to avoid it.
Using afterEvaluate
to solve the deferred configuration issue has made my code a lot cleaner than the conventionMapping approach.
class MyPlugin implements Plugin {
void apply(Project project) {
project.extensions.create('myPluginProps', MyPluginExtension)
project.afterEvaluate {
project.task(type: MyTask, 'thisTaskWorksIncorrectly') {
input = project.myPluginProps.message
}
}
}
}