Merge "Avoid circular dependency for the aconfig usage in libcore" into main am: a9d3293bf4

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2880848

Change-Id: I9e12749d85104b28d322c63c67fb8b1e65d679d2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Victor Chang
2023-12-19 20:46:38 +00:00
committed by Automerger Merge Worker

View File

@@ -62,10 +62,18 @@ func (callbacks *JavaAconfigDeclarationsLibraryCallbacks) DepsMutator(module *ja
ctx.AddDependency(ctx.Module(), declarationsTag, declarations)
}
// Add aconfig-annotations-lib as a dependency for the optimization / code stripping annotations
module.AddSharedLibrary("aconfig-annotations-lib")
// TODO(b/303773055): Remove the annotation after access issue is resolved.
module.AddSharedLibrary("unsupportedappusage")
// "libcore_aconfig_flags_lib" module has a circular dependency because the shared libraries
// are built on core_current and the module is used to flag the APIs in the core_current.
// http://b/316554963#comment2 has the details of the circular dependency chain.
// If a java_aconfig_library uses "none" sdk_version, it should include and build these
// annotation files as the shared library themselves.
var addLibraries bool = module.Library.Module.SdkVersion(ctx).Kind != android.SdkNone
if addLibraries {
// Add aconfig-annotations-lib as a dependency for the optimization / code stripping annotations
module.AddSharedLibrary("aconfig-annotations-lib")
// TODO(b/303773055): Remove the annotation after access issue is resolved.
module.AddSharedLibrary("unsupportedappusage")
}
}
func (callbacks *JavaAconfigDeclarationsLibraryCallbacks) GenerateSourceJarBuildActions(module *java.GeneratedJavaLibraryModule, ctx android.ModuleContext) android.Path {