Merge "Add previous_api
property to java_api_library
module" into main am: 9a3cd19bee
am: 7bdc85175f
am: 706d31cb27
am: 83ca3ce0ec
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2685826 Change-Id: I28f95330ce75165432604ad87c93dba884e8f9eb Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -1683,6 +1683,9 @@ type JavaApiLibraryProperties struct {
|
||||
// extracting the compiled class files provided by the
|
||||
// full_api_surface_stub module.
|
||||
Full_api_surface_stub *string
|
||||
|
||||
// Version of previously released API file for compatibility check.
|
||||
Previous_api *string `android:"path"`
|
||||
}
|
||||
|
||||
func ApiLibraryFactory() android.Module {
|
||||
@@ -1890,6 +1893,12 @@ func (al *ApiLibrary) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
||||
|
||||
al.stubsFlags(ctx, cmd, stubsDir)
|
||||
|
||||
migratingNullability := String(al.properties.Previous_api) != ""
|
||||
if migratingNullability {
|
||||
previousApi := android.PathForModuleSrc(ctx, String(al.properties.Previous_api))
|
||||
cmd.FlagWithInput("--migrate-nullness ", previousApi)
|
||||
}
|
||||
|
||||
al.stubsSrcJar = android.PathForModuleOut(ctx, "metalava", ctx.ModuleName()+"-"+"stubs.srcjar")
|
||||
al.stubsJarWithoutStaticLibs = android.PathForModuleOut(ctx, "metalava", "stubs.jar")
|
||||
al.stubsJar = android.PathForModuleOut(ctx, ctx.ModuleName(), fmt.Sprintf("%s.jar", ctx.ModuleName()))
|
||||
|
Reference in New Issue
Block a user