GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: make google-http-client.properties file shading friendly by medb · Pull Request #1046 · googleapis/google-http-java-client

Conversation

@medb

@medb medb commented May 21, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Fixes an issue when there are 2 versions of this library in a class path - 1) shaded/relocated library of x.x.x version inside a "jar-with-dependencies" and 2) non-shaded library of y.y.y version.

Because both of these libraries will load non-shaded google-http-client.properties file they will use the same y.y.y version even though shaded library has a x.x.x version.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@medb
medb requested a review from a team May 21, 2020 04:32
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label May 21, 2020
@chingor13 chingor13 changed the title Make google-http-client.properties file shading friendly fix: make google-http-client.properties file shading friendly Jun 19, 2020
@BenWhitehead

BenWhitehead commented Jun 19, 2020

Copy link
Copy Markdown
Contributor

@medb Can you describe why this change is needed? The properties file should be able to be loaded from an uber-jar or other shaded jar just fine without modification.

I have a local project on my machine I used to execute a few commands against Firestore (which is a downstream consumer of this library). This project is packaged as a "jar-with-dependencies" file. HttpRequest is able to load the properties files successfully as-is.

❱ java -jar target/cleanup-0.1.1-SNAPSHOT-jar-with-dependencies.jar 
HttpRequest.VERSION = 1.34.2

From this code

public static void main(String[] args) {
  System.out.println("HttpRequest.VERSION = " + com.google.api.client.http.HttpRequest.VERSION);
}
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@medb

medb commented Jun 20, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

@BenWhitehead The issue is that if there are 2 versions of this library in a class path - 1) shaded/relocated library of x.x.x version inside a "jar-with-dependencies" and 2) non-shaded library of y.y.y version.

Because both of these libraries will load non-shaded google-http-client.properties they will use the same y.y.y version even though shaded library has a x.x.x version.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@medb
fix: make google-http-client.properties file shading friendly
5dc3438
@BenWhitehead

BenWhitehead commented Jul 7, 2020

Copy link
Copy Markdown
Contributor

@chingor13 What are you thoughts here on moving the properties file? We might need to move it for the couple other libraries we introduced this same pattern in.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

chingor13
chingor13 approved these changes Oct 13, 2020
View reviewed changes
@chingor13 chingor13 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 13, 2020
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 13, 2020
@chingor13
chingor13 merged commit 860bb05 into googleapis:master Oct 13, 2020
@medb
medb deleted the patch-2 branch October 13, 2020 16:35
gcf-merge-on-green Bot pushed a commit that referenced this pull request Oct 13, 2020
@release-please
chore: release 1.37.0 (#1141)
0c1d58b
🤖 I have created a release \*beep\* \*boop\* 
---
## [1.37.0](https://www.github.com/googleapis/google-http-java-client/compare/v1.36.0...v1.37.0) (2020-10-13)


### Features

* add flag to allow UrlEncodedContent to use UriPath escaping ([#1100](https://www.github.com/googleapis/google-http-java-client/issues/1100)) ([9ab7016](https://www.github.com/googleapis/google-http-java-client/commit/9ab7016032327f6fb0f91970dfbd511b029dd949)), closes [#1098](https://www.github.com/googleapis/google-http-java-client/issues/1098)


### Bug Fixes

* make google-http-client.properties file shading friendly ([#1046](https://www.github.com/googleapis/google-http-java-client/issues/1046)) ([860bb05](https://www.github.com/googleapis/google-http-java-client/commit/860bb0541bcd7fc516cad14dd0d52481c7c7b414))


### Dependencies

* update protobuf-java to 3.13.0 ([#1093](https://www.github.com/googleapis/google-http-java-client/issues/1093)) ([b7e9663](https://www.github.com/googleapis/google-http-java-client/commit/b7e96632234e944e0e476dedfc822333716756bb))


### Documentation

* libraries-bom 12.0.0 ([#1136](https://www.github.com/googleapis/google-http-java-client/issues/1136)) ([450fcb2](https://www.github.com/googleapis/google-http-java-client/commit/450fcb2293cf3fa7c788cf0cc8ae48e865ae8de8))
---


This PR was generated with [Release Please](https://github.com/googleapis/release-please).
ruomengz added a commit to ruomengz/google-api-java-client that referenced this pull request Apr 28, 2023
@ruomengz
Update GoogleUtils.java to read absolute path of google-api-client.pr…
94f7593
…operties

- Make it file shading friendly like googleapis/google-http-java-client#1046
- Avoid set proguard config to read this file. b/279795343#comment2
@ruomengz ruomengz mentioned this pull request Apr 28, 2023
Read absolute path of google-api-client.properties googleapis/google-api-java-client#2299
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@chingor13 chingor13 chingor13 approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

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

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@medb @BenWhitehead @chingor13 @googlebot @kokoro-team
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.