Open nedtwigg opened 2 weeks ago
And we can publish snapshots on main branch, users can try out them as a workaround. I did this on
Excellent point @Goooler. We have JitPack setup, you can grab any commit you want at any time, see these instructions.
We should get rid of using jitpack. We are using io.github.gradle-nexus.publish-plugin
to publish maven artifacts to MavenCentral, MavenCentral's snapshots also support snapshot Gradle plugins. I'll send a PR later.
There are few thing to do:
io.github.gradle-nexus.publish-plugin
, I tried to migrate this but there are so many complex logic should be removed or cleaned up. More details about this point:
Some work has been addressed in #2236.
I don't like -SNAPSHOT
, because they change out from under you. Easy to end up with commits in history which can't be run in the future because the -SNAPSHOT
has changed. That said, I'm fine with adding support for them if you want them.
I love JitPack, because it's only a tiny bit harder to grab HEAD, but I know exactly which commit I'm getting, and I can even commit it and know that my old commits will be buildable / repeatable in the future.
Swapping gradle-nexus.publish-plugin
for vanniktech
definitely sounds great, and I'd be fine with adding -SNAPSHOT
as an option.
You can always pin snapshots on a specific version like
pluginManagement {
repositories {
maven("https://oss.sonatype.org/content/repositories/snapshots/")
}
}
plugins {
id("com.gradleup.shadow") version "8.3.0-20240808.050945-5" // a snapshot of 8.3.0
}
Figuring out which code is generating that snapshot is ambiguous. If it can be added without throwing out our current release pipeline, I'm okay with it, but I still think JitPack is a strictly better option for this usecase.
You can always pin snapshots on a specific version like
pluginManagement { repositories { maven("https://oss.sonatype.org/content/repositories/snapshots/") } } plugins { id("com.gradleup.shadow") version "8.3.0-20240808.050945-5" // a snapshot of 8.3.0 }
Please note that this does not work with how gradle plugins are resolved without extra steps! Remember that when you depend on a plugin by id, it actually resolves the module <plugin id>:<plugin id>.gradle.plugin:<plugin version>
-- so in this case, com.gradleup.shadow:com.gradleup.shadow.gradle.plugin:8.3.0-20240808.050945-5
. That module itself is only a single metadata file, and actually has a dependency on some other module where the plugin is actually located -- com.gradleup.shadow:shadow
in this case -- and that single pinned snapshot version has a generic -SNAPSHOT
dependency on the actual module, as com.gradleup.shadow:shadow:8.3.0-SNAPSHOT
, and it'll pull i nthe latest snapshot anyways. So, if you want to pin a gradle plugin to a single snapshot version instead of just the latest snapshot, you have to pin both the plugin that you depend on by ID, and the actual module the plugin is located at, through a dependency in a buildscript
block (I found this out the hard way, unfortunately).
No need to add an extra resolution strategy if you have published plugin markers. This is why I want to migrate to vanniktech in #2236, it will publish both plugin coordinates and markers.
I wasn't talking about resolution strategies. If both plugin markers and the actual plugin are published with -SNAPSHOT
versioning, then you'll still have the issue of pinning the plugin marker (via pinning the plugin when you depend on it by ID) transitively pulling in an unpinned actual plugin jar, which is what I was talking about. -SNAPSHOT
versions are just inherently rather painful with how the plugin marker works.
The whole point of Spotless is that formatting should not matter. If your formatting plugin is creating "new release" notifications every week then formatting is taking up more time in the ecosystem than it should.
Please don't spam other issues with comments related to "release please!". Keep that here.