Correct way to generate tasks from extensions?

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?

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.

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