Correct way to generate tasks from extensions?

software-model
plugins

(Mark Elliot) #1

I have an extension that I’d like to use to drive creation of several tasks, contingent on settings in the extension. Looking at, as an example, the MavenPublishPlugin, I see that this is now done, at least internally to Gradle, through the new Model work.

Is the MavenPublishPlugin/Model task-generation style the appropriate approach for a new plugin?


(Benjamin Muschko) #2

Is the MavenPublishPlugin/Model task-generation style the appropriate approach for a new plugin?

The work on the software model has stalled. Just to give you one of the reasons why the software model hasn’t progressed in the past months: a lot of existing, JVM-based plugins would have to be migrated to the software model to become useful in the overall ecosystem of an organization. Given that the build domain is very conservative, organizations don’t feel inclined in investing a lot into a rewrite. For more background on this announcement please also have a look at this video from the Gradle Summit 2016.

I’d recommend going with the current model in case you are planning to write a JVM-based plugin.


(Mark Elliot) #3

Thanks, that makes sense. Do you have any good/idiomatic examples of how to do this using the current model?