-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Automatically replace version references on release:prepare
#2212
Automatically replace version references on release:prepare
#2212
Conversation
5165808
to
30fabf4
Compare
release:prepare
30fabf4
to
24a1ed6
Compare
24a1ed6
to
a86f142
Compare
@@ -1299,10 +1302,10 @@ public <T> T fromJson(JsonElement json, Type typeOfT) throws JsonSyntaxException | |||
* @return an object of type T from the JSON. Returns {@code null} if {@code json} is {@code null} | |||
* or if {@code json} is empty. | |||
* @throws JsonSyntaxException if json is not a valid representation for an object of type typeOfT | |||
* @since 1.3 |
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.
This was a copy & paste error I made in #1700.
@@ -6,7 +6,6 @@ The following is a step-by-step procedure for releasing a new version of Google- | |||
1. Ensure all changelists are code-reviewed and have +1 | |||
1. `cd gson` to the parent directory; ensure there are no open files and all changes are committed. | |||
1. Run `mvn release:clean` | |||
1. Do a dry run: `mvn release:prepare -DdryRun=true` |
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.
Have removed this because it looks like this would prevent subsequent (non-dry-run) mvn release:prepare
from working properly (unless you made a rollback in between)?
OK, I think I should be ready to give this a spin shortly. |
Thanks! The disadvantage of this manual approach seem to be that the rollback does not revert the additionally committed files (see 7bca5c4). But luckily that did not matter here. Another thing to look out for is that it runs Also, do you happen to know how Guava does this? (quoting from the description)
|
One disadvantage might also be that |
Both Gson and Guava are mirrored between GitHub and Piper, Google's internal monorepo. But the mirroring is different: for Gson we copy from GitHub to Piper while for Guava we copy from Piper to GitHub. Before making a Guava release, we use a shell script to update the |
When running
mvn release:prepare
automatically updates the version references inREADME.md
andUserGuide.md
, and also replaces$next-version$
with the new version. This is mainly useful for Javadoc (e.g.@since $next-version$
) because it is not known in advance in which version a feature will be integrated.The current solution seems to work (have tested it locally), but it is rather hacky and might rely on some implementation details / quirks of Maven and the Maven Release Plugin. So no worries if you don't want to integrate this. There might be better ways to solve this; any feedback is appreciated.
It appears Guava has a special
@since NEXT
and also automatically adds missing@since
on release, but I was unable to find where exactly this is configured. Possibly it is usingjavadoc:fix
, but I was not successful with applying this for Gson.