Skip to content
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

Signing plugin does not use configuration avoidance APIs and causes eager creation of tasks #18477

Open
erdi opened this issue Sep 29, 2021 · 3 comments
Labels
a:feature A new functionality in:configuration-model lazy api, domain object container in:publishing-plugins ivy-publish maven-publish in:signing-plugin

Comments

@erdi
Copy link
Contributor

erdi commented Sep 29, 2021

For example, in Geb's build I'm using the following signing plugin configuration:

signing {
    ...
    publishing.publications.configureEach {
        sign(it)
    }
}

This causes the signing tasks for each of the publications to be created immediately and metadata file generation as well as pom file generation tasks to be created during configuration. You can see that for example signMainPublication tasks are created immediately in a build scan for running help task on geb/geb@e36e64d.

I would expect this plugin to be using configuration avoidance APIs given that any project publishing to Maven Central will most likely have it applied. The tasks eagerly created by signing plugin are the only ones which are outstanding to get Geb's build to not create any tasks during configuration when running help task.

@davidmc24 davidmc24 changed the title Singing plugin does not use configuration avoidance APIs and causes eager creation of tasks Signing plugin does not use configuration avoidance APIs and causes eager creation of tasks Sep 29, 2021
@tresat tresat added @idiomatic a:feature A new functionality in:provider-api property lazy provider MapProperty ListProperty DirectoryProperty in:publishing-plugins ivy-publish maven-publish and removed a:bug to-triage in:publishing-plugins ivy-publish maven-publish @idiomatic in:provider-api property lazy provider MapProperty ListProperty DirectoryProperty labels Oct 15, 2021
@tresat
Copy link
Member

tresat commented Oct 15, 2021

It looks like the publishing plugin is eagerly configuring all publications, so configureEach doesn't result in any lazy behavior. See:

@larsgrefer
Copy link
Contributor

These lines seem to be the problem:

final Sign signTask = project.getTasks().create(determineSignTaskNameForPublication(publicationToSign), Sign.class, new Action<Sign>() {

Sign signTask = project.getTasks().create("sign" + capitalize(name), Sign.class, taskConfiguration);

Unfortunately, the fix won't be trivial, since the public sign(...) methods on SigningExtension return List<Sign> instead of List<TaskProvider<Sign>>

@aSemy
Copy link
Contributor

aSemy commented Jun 4, 2022

I'm really struggling to use the signing plugin because it's very incompatible with configuration avoidance. Even plugins that try to improve it have issues vanniktech/gradle-maven-publish-plugin#259

Is there a workaround or alternative? I might try and re-implement it in my own project...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:feature A new functionality in:configuration-model lazy api, domain object container in:publishing-plugins ivy-publish maven-publish in:signing-plugin
Projects
None yet
Development

No branches or pull requests

6 participants