Update to sbt 2.0.0 and cross-publish plugin for sbt 1.x and 2.x#7
Draft
rolang wants to merge 1 commit into
Draft
Update to sbt 2.0.0 and cross-publish plugin for sbt 1.x and 2.x#7rolang wants to merge 1 commit into
rolang wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request upgrades the build to sbt 2.0.0 and updates the sbt plugin module so it can be published for both sbt 1.x (Scala 2.12) and sbt 2.x (Scala 3), with version-specific plugin implementation code split across Scala-versioned source directories.
Changes:
- Bumped sbt to
2.0.0and updated the build to cross-compile the core module for Scala 2.12/2.13/3. - Refactored the sbt plugin to delegate settings to a
GarCompatimplementation, split into Scala 2.12 (sbt 1) vs Scala 3 (sbt 2) source trees. - Added an Ivy-based Artifact Registry resolver/repository implementation for the sbt 1.x plugin variant.
Reviewed changes
Copilot reviewed 4 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| project/build.properties | Updates the build to run on sbt 2.0.0. |
| build.sbt | Adds Scala 3 cross-compilation and configures plugin cross-publishing for sbt 1 vs sbt 2. |
| modules/sbt/src/main/scala/dev/rolang/sbt/gar/GarPlugin.scala | Delegates plugin settings to a version-specific compatibility layer. |
| modules/sbt/src/main/scala-3/dev/rolang/sbt/gar/GarCompat.scala | sbt 2 / Scala 3 compatibility settings relying on JVM URL handler installation. |
| modules/sbt/src/main/scala-2.12/dev/rolang/sbt/gar/GarCompat.scala | sbt 1 / Scala 2.12 compatibility settings, including coursier protocol handler deps + Ivy resolver mapping. |
| modules/sbt/src/main/scala-2.12/dev/rolang/sbt/gar/ArtifactRegistryIvyRepository.scala | New Ivy repository/resolver implementation for Artifact Registry publishing/resolution on sbt 1.x. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Upgrade the build to sbt 2.0.0 and configure the sbt plugin module to cross-publish for both sbt 1.x and sbt 2.x.
Changes
project/build.propertiesupdated tosbt.version=2.0.0pluginmodule now cross-builds for Scala 2.12 (sbt 1.12.11) and Scala 3.8.4 (sbt 2.0.0) viapluginCrossBuild / sbtVersionmappingsrc/main/scala-2.12/— sbt 1 settings with Ivy-based resolver,csrConfiguration,insyntaxsrc/main/scala-3/— sbt 2 settings with/syntax, no Ivy dependency, relies on Java URL handler forartifactregistry://project/update.sbt(sbt-dependency-updatesnot available for sbt 2),project/metals.sbt(auto-generated, incompatible plugins)localStaging,sonaRelease)Plugin artifacts
Two plugin artifact variants are published:
sbt-gar-handler_2.12_1.0— for sbt 1.xsbt-gar-handler_sbt2_3— for sbt 2.xTest plan
sbt +compilecross-compiles all modules for all target Scala versions (2.12, 2.13, 3.8)sbt +Test/compilecross-compiles testscore/compile,coursier/compile,plugin/compileall pass