Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 83ca3ce0 authored by Jihoon Kang's avatar Jihoon Kang Committed by Automerger Merge Worker
Browse files

Merge "Add `previous_api` property to `java_api_library` module" into main am:...

Merge "Add `previous_api` property to `java_api_library` module" into main am: 9a3cd19b am: 7bdc8517 am: 706d31cb

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



Change-Id: I2beb05fdae197b1dc0d040c48d415ff55d876615
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 1220ef55 706d31cb
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -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()))