-
Notifications
You must be signed in to change notification settings - Fork 76
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
Better support for sbt artifacts in the Scaladex badge #674
Merged
Conversation
This file contains 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
Each release of sbt uses a specific version of Scala (1.0 uses Scala 2.12, 0.13 uses Scala 2.10), so the sbt version of a plugin fully determines the Scala language binary version it uses - this means, for a user, it's only really interesting to know the sbt version of the plugin, not the Scala language version. At the moment, the Scaladex badge for, eg, the `sbt-assembly` plugin reads `1.0.0 (Scala 2.12, 2.10)` - for the user, it would be more helpful if it read `1.0.0 (sbt 1.0, 0.13)` - listing the versions of sbt you can actually use it with! Although the Scaladex badge did have some logic to display the platform versions supported by _all_ listed Scala language versions, that doesn't help in this situation, as the Scala language version differs for each platform version of sbt. See also this comment from a prior PR: scalacenter#670 (comment) This commit updates the Scaladex badge logic to have two version-summary strategies: * `SummariseLanguageVersion` - which was the existing strategy, listing notable Scala version support, secondarily adding in a summary of platform editions (eg 'Scala 2.13 - Native 0.4+0.3') * `SummarisePlatformEdition` - the new strategy, which is used if *all* fetched `ScalaTarget`s for an artifact have a `targetType` for which the platform version fully determines the Scala version (as is the case for sbt). It omits the Scala version from the summary, and just relates the platform versions (eg `sbt 1.0, 0.13`)
adpi2
approved these changes
Jul 5, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two minor comments, otherwise LGTM. Thanks for improving this!
server/src/main/scala/ch.epfl.scala.index.server/BadgesSupport.scala
Outdated
Show resolved
Hide resolved
server/src/main/scala/ch.epfl.scala.index.server/BadgesSupport.scala
Outdated
Show resolved
Hide resolved
….scala Co-authored-by: Adrien Piquerez <adrien.piquerez@gmail.com>
Thanks! Looks good in prod on, eg, https://index-dev.scala-lang.org/sbt/sbt-assembly/sbt-assembly#badge-markdown : |
rtyley
added a commit
to rtyley/sbt-assembly
that referenced
this pull request
Jul 5, 2021
Unfortunately the Bintray badge just reads 'no longer available' these days, I guess due to https://jfrog.com/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/ . The new Scaladex badge can replace the old Bintray badge. It summarises which versions of sbt are supported by sbt-assembly (and what the latest sbt-assembly version is for each of those sbt versions): [![sbt-assembly Scala version support](https://index.scala-lang.org/sbt/sbt-assembly/sbt-assembly/latest-by-scala-version.svg?targetType=Sbt)](https://index.scala-lang.org/sbt/sbt-assembly/sbt-assembly) More details on the badge format here: https://github.com/scalacenter/scaladex/pull/#660 - with some extra changes to better support sbt in scalacenter/scaladex#674.
rtyley
added a commit
to rtyley/sbt-native-packager
that referenced
this pull request
Jul 5, 2021
Unfortunately the Bintray badge on the readme is broken, I guess due to Bintray being [sunset](https://jfrog.com/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/)? However, this new Scaladex badge can replace the old Bintray badge - it summarises which versions of sbt are supported by sbt-native-packager (and what the latest sbt-native-packager version is for each of those sbt versions): [![sbt-native-packager Scala version support](https://index.scala-lang.org/sbt/sbt-native-packager/sbt-native-packager/latest-by-scala-version.svg?targetType=Sbt)](https://index.scala-lang.org/sbt/sbt-native-packager/sbt-native-packager) More details on the badge format here: scalacenter/scaladex#660 (with some extra changes to better support sbt in scalacenter/scaladex#674).
rtyley
added a commit
to rtyley/sbt-release
that referenced
this pull request
Jul 5, 2021
The Scaladex badge is a bit more helpful than the Maven Central badge - it summarises which versions of sbt are supported by sbt-release (and what the latest sbt-release version is for each of those sbt versions): [![sbt-release Scala version support](https://index.scala-lang.org/sbt/sbt-release/sbt-release/latest-by-scala-version.svg?targetType=Sbt)](https://index.scala-lang.org/sbt/sbt-release/sbt-release) More details on the badge format here: scalacenter/scaladex#660 (with some extra changes to better support sbt in scalacenter/scaladex#674).
xuwei-k
pushed a commit
to sbt/sbt-release
that referenced
this pull request
Jul 5, 2021
The Scaladex badge is a bit more helpful than the Maven Central badge - it summarises which versions of sbt are supported by sbt-release (and what the latest sbt-release version is for each of those sbt versions): [![sbt-release Scala version support](https://index.scala-lang.org/sbt/sbt-release/sbt-release/latest-by-scala-version.svg?targetType=Sbt)](https://index.scala-lang.org/sbt/sbt-release/sbt-release) More details on the badge format here: scalacenter/scaladex#660 (with some extra changes to better support sbt in scalacenter/scaladex#674).
muuki88
pushed a commit
to sbt/sbt-native-packager
that referenced
this pull request
Jul 8, 2021
Unfortunately the Bintray badge on the readme is broken, I guess due to Bintray being [sunset](https://jfrog.com/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/)? However, this new Scaladex badge can replace the old Bintray badge - it summarises which versions of sbt are supported by sbt-native-packager (and what the latest sbt-native-packager version is for each of those sbt versions): [![sbt-native-packager Scala version support](https://index.scala-lang.org/sbt/sbt-native-packager/sbt-native-packager/latest-by-scala-version.svg?targetType=Sbt)](https://index.scala-lang.org/sbt/sbt-native-packager/sbt-native-packager) More details on the badge format here: scalacenter/scaladex#660 (with some extra changes to better support sbt in scalacenter/scaladex#674).
rtyley
added a commit
to rtyley/sbt-buildinfo
that referenced
this pull request
Nov 12, 2021
Unfortunately the Bintray badge on the readme just reads [_'no longer available'_](https://jfrog.com/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/) these days: ![Bintray version](https://img.shields.io/bintray/v/eed3si9n/sbt-plugins/sbt-buildinfo.svg) However, this new Scaladex badge can replace the old Bintray badge - it summarises which versions of sbt are supported by sbt-buildinfo (and what the latest sbt-buildinfo version is for each of those sbt versions): [![sbt-buildinfo Scala version support](https://index.scala-lang.org/sbt/sbt-buildinfo/sbt-buildinfo/latest-by-scala-version.svg?targetType=Sbt)](https://index.scala-lang.org/sbt/sbt-buildinfo/sbt-buildinfo) More details on the badge format here: scalacenter/scaladex#660 (with sbt-focused support in scalacenter/scaladex#674).
rtyley
added a commit
to rtyley/sbt-updates
that referenced
this pull request
Feb 11, 2022
The Scaladex badge is a bit more helpful than the Maven Central badge - it summarises which versions of sbt are supported by sbt-updates (and what the latest sbt-updates version is for each of those sbt versions: [![sbt-updates Scala version support](https://index.scala-lang.org/rtimush/sbt-updates/sbt-updates/latest-by-scala-version.svg?targetType=Sbt)](https://index.scala-lang.org/rtimush/sbt-updates/sbt-updates) Interestingly, at the moment, there is a new 0.6.2 release of `sbt-updates` for sbt 0.13, but not for 1.0, which wouldn't have been indicated by the old badge! More details on the badge format here: scalacenter/scaladex#660 (with some extra changes to better support sbt in scalacenter/scaladex#674).
littleRoundaer
added a commit
to littleRoundaer/sbt-native-packager
that referenced
this pull request
Jul 19, 2022
Unfortunately the Bintray badge on the readme is broken, I guess due to Bintray being [sunset](https://jfrog.com/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/)? However, this new Scaladex badge can replace the old Bintray badge - it summarises which versions of sbt are supported by sbt-native-packager (and what the latest sbt-native-packager version is for each of those sbt versions): [![sbt-native-packager Scala version support](https://index.scala-lang.org/sbt/sbt-native-packager/sbt-native-packager/latest-by-scala-version.svg?targetType=Sbt)](https://index.scala-lang.org/sbt/sbt-native-packager/sbt-native-packager) More details on the badge format here: scalacenter/scaladex#660 (with some extra changes to better support sbt in scalacenter/scaladex#674).
rtimush
pushed a commit
to rtyley/sbt-updates
that referenced
this pull request
Nov 14, 2023
The Scaladex badge is a bit more helpful than the Maven Central badge - it summarises which versions of sbt are supported by sbt-updates (and what the latest sbt-updates version is for each of those sbt versions: [![sbt-updates Scala version support](https://index.scala-lang.org/rtimush/sbt-updates/sbt-updates/latest-by-scala-version.svg?targetType=Sbt)](https://index.scala-lang.org/rtimush/sbt-updates/sbt-updates) Interestingly, at the moment, there is a new 0.6.2 release of `sbt-updates` for sbt 0.13, but not for 1.0, which wouldn't have been indicated by the old badge! More details on the badge format here: scalacenter/scaladex#660 (with some extra changes to better support sbt in scalacenter/scaladex#674).
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.
Each release of sbt uses a specific version of Scala (1.0 uses Scala 2.12, 0.13 uses Scala 2.10), so the sbt version of a plugin fully determines the Scala language binary version it uses - this means, for a user, it's only really interesting to know the sbt version of the plugin, not the Scala language version.
At the moment, the Scaladex badge for, eg, the
sbt-assembly
plugin reads:(
1.0.0 (Scala 2.12, 2.10)
)...for the user, it would be more helpful if it read:
(
1.0.0 (sbt 1.0, 0.13)
)...listing the versions of sbt you can actually use it with! Although the Scaladex badge did have some logic to display the platform versions supported by all listed Scala language versions, that doesn't help in this situation, as the Scala language version differs for each platform version of sbt. See also this comment from a prior PR.
This PR refactors the Scaladex badge logic to have two version-summary strategies:
SummariseLanguageVersion
- which was the existing strategy, listing notable Scala version support, secondarily adding in a summary of platform editions (eg 'Scala 2.13 - Native 0.4+0.3')SummarisePlatformEdition
- the new strategy, which is used if all fetchedScalaTarget
s for an artifact have atargetType
for which the platform version fully determines the Scala version (as is the case for sbt). It omits the Scala version from the summary, and just relates the platform versions (egsbt 1.0, 0.13
)The refactor is quite a substantial rearrangement of the code in
BadgesSupport.scala
unfortunately, and so the diff is quite hard to read - might be better to just read the updated final version. Tests inBadgesSupportTest.scala
have been added/updated to check for the new sbt case.cc @adpi2