Rule based model & Task rules

While trying to port an existing plugin to the rule based model, I found that it does not seem to be possible to create a task rule using the model, nor is it possible to configure the model using a task rule.

The latter results in an exception:

Cannot add rule model.releases for model element ‘releases’ at state Initialized as this element is already at state GraphClosed.

Is there an alternative to task rules? Ideally I would use some model input type that provides me with the currently called task name and I could setup my model/tasks based on that, but I did not find a suitable model element that carries that.

I would hold back porting anything to the rule-based model as it is all changing and are being simplified.

For status of the software model and rule-based configuration engine see https://blog.gradle.org/state-and-future-of-the-gradle-software-model.

Thank you, I was not aware of that. I had it on my list of things to look into for a while and started playing around with it yesterday after being fed up with afterEvaluate constructs.