Skip to content

fix: make google-http-client.properties file shading friendly#1046

Merged
chingor13 merged 1 commit intogoogleapis:masterfrom
medb:patch-2
Oct 13, 2020
Merged

fix: make google-http-client.properties file shading friendly#1046
chingor13 merged 1 commit intogoogleapis:masterfrom
medb:patch-2

Conversation

@medb
Copy link
Copy Markdown
Contributor

@medb medb commented May 21, 2020

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.

@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
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);
}

@medb
Copy link
Copy Markdown
Contributor Author

medb commented Jun 20, 2020

@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.

@BenWhitehead
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.

@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
🤖 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
…operties

- Make it file shading friendly like googleapis/google-http-java-client#1046
- Avoid set proguard config to read this file. b/279795343#comment2
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.

5 participants