It appears that the PublicationsExtension is forced to be configured as part of the ResolveDeferredConfigurableAction (via ExtensionContainerInternal.getAsMap()). This means that by the time afterEvaluate runs, you are no longer able to configure the PublishingExtension. Consequently, if I have a plugin that needs to be configured by the user (hence has to run in afterEvaluate), I can not influence the PublishingExtension. This seems like a flaw. This implicitly means, to me, that Extensions can not be used to affect the creation of tasks or publications, their value seems to be solely in configuring a task, since a task won’t be run till after afterEvaluate.
For example, I have an Extension for my plugin that is set by the user to tells me what to put into the publication. I seemed to be caught in an impossible situation: once I defer to afterEvaluate to get their values, I can no longer call project.extensions.configure(PublishingExtension).
Can the ResolveDeferredConfigurableAction be delayed until after the afterEvaluates are run?