New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make PublishingExtension behave like other extension objects #4945

Closed
oehme opened this Issue Apr 5, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@oehme
Member

oehme commented Apr 5, 2018

The PublishingExtension currently uses the (never finished) DeferredConfigurable concept. This leads to some confusing behavior like #2496. The extension should behave more like other extensions. The reason to defer it was that we only want to create the tasks once all publications and repositories are known. But there are too many cases when users could accidentally force early resolution of those tasks.

We can probably use the approach from the new native plugins to solve this issue better, i.e. by having a clear point in the lifecycle where those tasks are created.

The goal is to keep the current DSL intact (i.e. don't create yet another publishing DSL/plugin) and keep existing builds working while fixing the early evaluation traps that users ran into. This may require some interim solution which is still slightly different from other extensions to minimize the potential for breaking changes.

Eventually though we should unify how we treat laziness across all plugins, including this one. This should include using the provider API for deferred computation #4467 and only creating publication tasks when necessary. This end goal may require some small breaking changes in a major release.

@oehme oehme added this to the 4.8 RC1 milestone Apr 5, 2018

@oehme oehme added the epic label Apr 5, 2018

@eskatos

This comment has been minimized.

Member

eskatos commented Apr 5, 2018

IIRC, PublishingExtension is the sole DeferredConfigurable. This change could be an opportunity to deprecate DeferredConfigurable.

@oehme

This comment has been minimized.

Member

oehme commented Apr 10, 2018

After spiking this, I think we have a good way forward:

  • remove DeferredConfigurable
  • make MavenPublication/IvyPublication and MavenArtifact/IvyArtifact lazy. For instance, don't snapshot project.version when the publication is created, but keep it live till we need the metadata. This passed all our tests and also works with the nebula-publish plugin
  • create the publishing tasks using publications.all { repositories.all { /* task */ } }, thereby removing the need for model rules and making the publishing tasks easier to configure from build scripts

@oehme oehme self-assigned this May 2, 2018

@oehme oehme closed this May 2, 2018

@oehme oehme reopened this May 2, 2018

@oehme oehme closed this May 2, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment