From 423d229c3b99b1204aa314cdd69b62e8cbf6233a Mon Sep 17 00:00:00 2001 From: Jihoon Kang Date: Tue, 29 Nov 2022 23:10:10 +0000 Subject: [PATCH] Add phony rule for java_api_library module type Context - Create phony rule for java_api_library module with its artifact (*.jar) as dependency - Fix source directory base mislinkage issue for input text files passed from java_api_contributions modules Test: m Change-Id: I055332fd5bc7ef0d03e7b311b0efa93f4454102f --- java/java.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/java/java.go b/java/java.go index 25b6349bf..bdd71427e 100644 --- a/java/java.go +++ b/java/java.go @@ -1648,7 +1648,7 @@ func (al *ApiLibrary) GenerateAndroidBuildActions(ctx android.ModuleContext) { var srcFiles []android.Path ctx.VisitDirectDepsWithTag(javaApiContributionTag, func(dep android.Module) { provider := ctx.OtherModuleProvider(dep, JavaApiImportProvider).(JavaApiImportInfo) - srcFiles = append(srcFiles, android.PathForModuleSrc(ctx, provider.ApiFile.String())) + srcFiles = append(srcFiles, android.PathForSource(ctx, provider.ApiFile.String())) }) cmd := metalavaStubCmd(ctx, rule, srcFiles, homeDir) @@ -1673,6 +1673,8 @@ func (al *ApiLibrary) GenerateAndroidBuildActions(ctx android.ModuleContext) { TransformJavaToClasses(ctx, al.stubsJar, 0, android.Paths{}, android.Paths{al.stubsSrcJar}, flags, android.Paths{}) + + ctx.Phony(ctx.ModuleName(), al.stubsJar) } //