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

feat: support prerelease version increments #393

Merged
merged 7 commits into from
Dec 27, 2023

Conversation

Andrapyre
Copy link
Contributor

This PR adds support for incrementing prerelease versions by default, if it ends in a number. Currently, if a prerelease version is incremented, the prerelease qualifier is simply dropped. E.g. 1.0.0-RC1 will be incremented to 1.0.0. After this merge, 1.0.0-RC1 will be incremented to 1.0.0-RC2, but prerelease versions without a version number will behave as before: 1.0.0-alpha will be incremented to 1.0.0.

Additionally, the .asSnapshot method will include the prerelease version. E.g. 1.0.0-RC1 will return 1.0.0-RC1-SNAPSHOT.

This PR also adds type declarations for public members in the Version class, as well as some ScalaDocs.

@Andrapyre
Copy link
Contributor Author

Andrapyre commented Dec 22, 2023

@xuwei-k , is this project still active? It looks like it's been two years since the last release. Not sure if you're open to taking on any official maintainers, but happy to help in that way or just with regular contributions. This plugin has been super helpful in my work. Thanks for keeping it going!

build.sbt Outdated
email = "@xuwei-k",
url = url("https://github.com/xuwei-k")
)
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert some unnecessary changes.

@Andrapyre Andrapyre force-pushed the feat-prerelease-version-increments branch from 0d85585 to db7320e Compare December 24, 2023 02:22
@Andrapyre
Copy link
Contributor Author

@xuwei-k , I've removed all changes to build.sbt except standardizing the scala version. I also realized that .withoutQualifier is no longer being used in the code base after my changes, so I've marked it as deprecated in favor of .withoutSnapshot.

build.sbt Outdated Show resolved Hide resolved
Co-authored-by: kenji yoshida <6b656e6a69@gmail.com>
@Andrapyre
Copy link
Contributor Author

@xuwei-k , I've reverted the scala version change, as you've requested, but just curious for some context - isn't it best practice to declare scala versions in the build config so as to avoid different local environments building with a different scala version?

@Andrapyre
Copy link
Contributor Author

@xuwei-k , now that the changes to build.sbt are reverted, would you be able to merge this PR?

@xuwei-k xuwei-k merged commit 5fea9d8 into sbt:master Dec 27, 2023
3 checks passed
xuwei-k added a commit that referenced this pull request Dec 28, 2023
xuwei-k added a commit that referenced this pull request Dec 28, 2023
Andrapyre pushed a commit to Andrapyre/sbt-release that referenced this pull request Dec 29, 2023
Andrapyre added a commit to Andrapyre/sbt-release that referenced this pull request Dec 29, 2023
@SethTisue
Copy link
Member

isn't it best practice to declare scala versions in the build config so as to avoid different local environments building with a different scala version?

sbt plugins are a bit unusual in this respect. The Scala version used is determined by the sbt version being used, so it's not really necessary to also pin the Scala version by other means.

Andrapyre pushed a commit to Andrapyre/sbt-release that referenced this pull request Jan 19, 2024
Andrapyre added a commit to Andrapyre/sbt-release that referenced this pull request Jan 19, 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
Development

Successfully merging this pull request may close these issues.

3 participants