Open HappyHacker123 opened 7 months ago
@blakeli0 @alicejli Could you help me review this issue? Many thanks :)
First of all, you are not supposed to use or access BlobHttpContent
. The intention is that only those classes under the api
directiory are the public surface of the jib-core library.
(However, I admit I may not be understanding the gist of this issue.)
@chanseokoh Thanks for your prompt reponese :).
Actually i'm mainly talking about the listed dependencies should be set to configuration api
instead of implementation
. The example of BlobHttpContent
is just showing possible consequence of wrong configuration. Below are gradle official doc on api
dependencies.
So when should you use the api configuration? An API dependency is one that contains at least one type that is exposed in the library binary interface, often referred to as its ABI (Application Binary Interface). This includes, but is not limited to:
- types used in super classes or interfaces
- types used in public method parameters, including generic parameter types (where public is something that is visible to compilers. I.e. , public, protected and package private members in the Java world)
- types used in public fields
- public annotation types
According to the doc, there are mainly four situations that the dependency should be set to api
. So, in the above issue body, I'm listing where these dependencis meet one of these criteria and thus should be set to api
.
Environment:
Description of the issue: The following dependencies in jib-core are set to scoep implementation, but the expected scope should api.
According to gradle offcial doc,if a library contains classes that are exposed in the library binary interface, its dependency scope should be api. The above depedencies all contain classes exposed in binary interface as offical doc goes, I list one example of each dependency below.
Expected behavior: The dependencies scope should be changed to api. Otherwise it can lead to compilation failures in consumers, as mentioned in offical doc. I will give an example to reproduce below.
Steps to reproduce: Import jib-core as a dependency in a project and try to access BlobHttpContent like the below class. Compilation will fail due to GOOGLE_HTTP_CLIENT is set to implementation and not api.