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
diff --git a/java/java.go b/java/java.go
index 25b6349..bdd7142 100644
--- a/java/java.go
+++ b/java/java.go
@@ -1648,7 +1648,7 @@
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 @@
TransformJavaToClasses(ctx, al.stubsJar, 0, android.Paths{},
android.Paths{al.stubsSrcJar}, flags, android.Paths{})
+
+ ctx.Phony(ctx.ModuleName(), al.stubsJar)
}
//