From 031d8693b3dae7edaca2e5fef3d017ac2e67424d Mon Sep 17 00:00:00 2001 From: Paul Duffin Date: Fri, 12 Feb 2021 11:46:42 +0000 Subject: Allow explicitly specified additional annotations for hiddenapi Adds the hiddenapi_additional_annotations to allow a library to list the libraries that provided additional hiddenapi related annotations for a library. Modifies merge_csv.py so it can process multiple zip files at the same time and uses that to merge the embedded .uau files from a module and those it depends upon. Bug: 180102243 Test: m droid Verified that hiddenapi files (both aggregated ones and for the individual modules) are not affected by this change. Change-Id: I796520021c7357398a9e2a09f1029e4a578b05b3 --- java/java.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'java/java.go') diff --git a/java/java.go b/java/java.go index 338140bbf..e14815e92 100644 --- a/java/java.go +++ b/java/java.go @@ -298,6 +298,9 @@ type CompilerProperties struct { // If true, package the kotlin stdlib into the jar. Defaults to true. Static_kotlin_stdlib *bool `android:"arch_variant"` + + // A list of java_library instances that provide additional hiddenapi annotations for the library. + Hiddenapi_additional_annotations []string } type CompilerDeviceProperties struct { @@ -840,6 +843,9 @@ func (j *Module) deps(ctx android.BottomUpMutatorContext) { libDeps := ctx.AddVariationDependencies(nil, libTag, rewriteSyspropLibs(j.properties.Libs, "libs")...) ctx.AddVariationDependencies(nil, staticLibTag, rewriteSyspropLibs(j.properties.Static_libs, "static_libs")...) + // Add dependency on libraries that provide additional hidden api annotations. + ctx.AddVariationDependencies(nil, hiddenApiAnnotationsTag, j.properties.Hiddenapi_additional_annotations...) + if ctx.DeviceConfig().VndkVersion() != "" && ctx.Config().EnforceInterPartitionJavaSdkLibrary() { // Require java_sdk_library at inter-partition java dependency to ensure stable // interface between partitions. If inter-partition java_library dependency is detected, -- cgit v1.2.3