diff options
author | 2023-08-14 20:50:32 +0000 | |
---|---|---|
committer | 2023-08-14 20:50:32 +0000 | |
commit | 9a3cd19bee95f0296463f4bae3c5d0e28654d263 (patch) | |
tree | 3c978c25e479e81f2e2a378bb3354b00828486c2 /java/java.go | |
parent | 6a299f7d34124a8d0ac7926a0ef3e101dd02de57 (diff) | |
parent | 862da6f2339b30fba4b36ad8c0f39a583933266a (diff) |
Merge "Add `previous_api` property to `java_api_library` module" into main
Diffstat (limited to 'java/java.go')
-rw-r--r-- | java/java.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/java/java.go b/java/java.go index 6667a52f1..70aba8e2c 100644 --- a/java/java.go +++ b/java/java.go @@ -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())) |