java_sdk_library: Create separate impl library
Most dependencies on java_sdk_library instances (JSL) simply reference them by name and rely on the build to pick the correct part, impl, stubs for a specific scope, headers or implementation jars or dex jars. Generally, the build gets that decision right. If it does not the for most of the components of the JSL there is a way to reference them directly. However, that is not true for the implementation library as that is created the JSL itself. Access to the implementation library should be avoided as it opens up the possibility that use will be made of an API that is not tracked and maintained which could lead to compatibility issues. However, there is a case where use of the implementation library is required and safe. That is when it is being used from other libraries within the same APEX as the JSL. In that case the JSL and its dependencies will be updated together so compatibility is not an issue. This change adds a new <module>.impl java_library that compiles the implementation library in the same way as the JSL itself does. This will allow the modules that are blocked from converting to JSL because of this limitation to progress. Initially the library is only for use for compiling but follow up changes will switch the rest of the build from using the implementation library created by JSL to the separate module. It also adds the ability to give the separate .impl library a more restrictive visibility than the JSL further limiting misuse. Bug: 156618935 Test: m droid, flash, atest CtsProviderTestCases - sniff test tested that it fixes compilation issues with mainline module Change-Id: Ifc4799feb4ada9dec8021efc13fe6a953bf2edd3
Loading
Please register or sign in to comment