Skip to content

feat: recognize x-version-update markers in ClientVersion.java - #317

Closed
igorbernstein2 wants to merge 1 commit into
googleapis:masterfrom
igorbernstein2:patch-1
Closed

feat: recognize x-version-update markers in ClientVersion.java#317
igorbernstein2 wants to merge 1 commit into
googleapis:masterfrom
igorbernstein2:patch-1

Conversation

@igorbernstein2

Copy link
Copy Markdown

It would be very useful to have a way for client developers to embed the project version inside a java class.
There are currently 2 approaches that client devs can use:

  1. read the jar manifest
  2. use resource filtering to inject maven properties into a resource file

However both of these have limitations:

  1. doesn't work when the client code is shaded into a parent uberjar
  2. doesn't work when imported in g3

This new approach solves all of the limitations by allowing client devs to read it directly from a compiled class file which will always be available

It would be very useful to have a way for client developers to embed the project version inside a java class. 
There are currently 2 approaches that client devs can use:
1. read the jar manifest
2. use resource filtering to inject maven properties into a resource file

However both of these have limitations:
1. doesn't work when the client code is shaded into a parent uberjar
2. doesn't work when imported in g3

This new approach solves all of the limitations by allowing client devs to read it directly from a compiled class file which will always be available
@igorbernstein2
igorbernstein2 requested a review from a team April 9, 2021 15:07
@google-cla google-cla Bot added the cla: yes This human has signed the Contributor License Agreement. label Apr 9, 2021
@chingor13

Copy link
Copy Markdown
Contributor

We probably want this in release-please. This is the legacy tool that must be run from the command line

igorbernstein2 added a commit to igorbernstein2/java-bigtable that referenced this pull request Apr 9, 2021
Use new feature in releasetool (googleapis/releasetool#317) to manage the client version instead of maven tricks introduced in googleapis#451
@chingor13

Copy link
Copy Markdown
Contributor

Closing this in favor of googleapis/release-please#850

@chingor13 chingor13 closed this Apr 9, 2021
igorbernstein2 added a commit to googleapis/java-bigtable that referenced this pull request Apr 13, 2021
* chore: improve embedded version handling

Use new feature in releasetool (googleapis/releasetool#317) to manage the client version instead of maven tricks introduced in #451

* migrate to new version scheme

* rename back to Version

* config release-please for version bumps

* make sure file doesnt get clobbered

* add a couple of tests

* fmt
kolea2 pushed a commit to kolea2/java-bigtable that referenced this pull request May 20, 2021
* chore: improve embedded version handling

Use new feature in releasetool (googleapis/releasetool#317) to manage the client version instead of maven tricks introduced in googleapis#451

* migrate to new version scheme

* rename back to Version

* config release-please for version bumps

* make sure file doesnt get clobbered

* add a couple of tests

* fmt

(cherry picked from commit 1af8925)
kolea2 added a commit to googleapis/java-bigtable that referenced this pull request May 21, 2021
* chore: improve embedded version handling (#715)

* chore: improve embedded version handling

Use new feature in releasetool (googleapis/releasetool#317) to manage the client version instead of maven tricks introduced in #451

* migrate to new version scheme

* rename back to Version

* config release-please for version bumps

* make sure file doesnt get clobbered

* add a couple of tests

* fmt

(cherry picked from commit 1af8925)

* update version

* fix test

* fix: add back in extraFiles and fix file path (#833)

(cherry picked from commit f914954)

* fix test

Co-authored-by: Igor Bernstein <igorbernstein@google.com>
benjaminp pushed a commit to benjaminp/google-cloud-java that referenced this pull request Jul 13, 2026
* chore: improve embedded version handling

Use new feature in releasetool (googleapis/releasetool#317) to manage the client version instead of maven tricks introduced in googleapis/java-bigtable#451

* migrate to new version scheme

* rename back to Version

* config release-please for version bumps

* make sure file doesnt get clobbered

* add a couple of tests

* fmt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants