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

Allow using version catalog plugins without version #18728

Closed
wants to merge 5 commits into from

Conversation

asodja
Copy link
Member

@asodja asodja commented Oct 21, 2021

Fixes #18236
Fixes #18467

Changes:

  • plugins can now have no version in version catalog: with API this can be done with alias("alias").toPluginId("id").withoutVersion(), in TOML you can do any of:
[plugins]
my-plugin1 = "plugin.id"
my-plugin2 = { id = "plugin.id" }
my-plugin3 = { id = "plugin.id"  version = ""}
  • generated accessors for plugins now implements PluginDependencyProvider that have getWithoutVersion() method, so you can do:
plugins {
    alias(libs.my.plugin.withoutVersion)
}

I am not perfectly happy with alias(libs.my.plugin.withoutVersion) it feels verbose, but other solutions are trickier.

Maybe alternative alias(libs.my.plugin).withoutVersion() could be interesting, but in that case we should change logic of alias(libs.my.plugin).version(null): now it fails, but it could set version to unspecified. Interestingly docs of PluginDependencySpec already say that null does that.

@github-actions
Copy link
Contributor

❌ Contributor CI Build failed: https://ge.gradle.org/s/xdynfibit7uiq

@github-actions
Copy link
Contributor

❌ Contributor CI Build failed: https://ge.gradle.org/s/7zwsumr6735y4

@asodja asodja force-pushed the asodja/version-catalog-18236 branch from d3b9828 to d801539 Compare October 22, 2021 10:54
@asodja
Copy link
Member Author

asodja commented Oct 22, 2021

@bot-gradle test QFL

@bot-gradle
Copy link
Collaborator

OK, I've already triggered QuickFeedbackLinux build for you.

@asodja
Copy link
Member Author

asodja commented Oct 22, 2021

@bot-gradle test this

@gradle gradle deleted a comment from asodja Oct 22, 2021
@bot-gradle
Copy link
Collaborator

OK, I've already triggered ReadyForMerge build for you.

@asodja asodja changed the title Initial commit for version catalog plugins without version Allow using version catalog plugins without version Oct 22, 2021
@asodja asodja requested a review from ljacomet October 22, 2021 14:13
@asodja asodja marked this pull request as ready for review October 22, 2021 14:14
@asodja asodja added this to the 7.4 RC1 milestone Oct 22, 2021
@asodja
Copy link
Member Author

asodja commented Oct 22, 2021

I probably should also restrict withoutVersion keyword in plugin... Yeah, this is one more thing why I am not that happy with alias(libs.my.plugin.withoutVersion)

@ljacomet
Copy link
Member

Closed in favor of #19015

@ljacomet ljacomet closed this Nov 26, 2021
@ov7a ov7a removed this from the 7.4 RC1 milestone Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants