summaryrefslogtreecommitdiff
path: root/java/java.go
diff options
context:
space:
mode:
authorUlya Trafimovich <skvadrik@google.com>2020-09-01 17:33:48 +0100
committerUlya Trafimovich <skvadrik@google.com>2020-09-01 17:45:39 +0100
commit21a73752054595c0e3cad5fa38dbedc2218998a2 (patch)
tree7e9cd4d43ac028828dcbe0aa0ac68ec3f3b0fa0b /java/java.go
parent588aae727bf352a1512a69c92e0af330977f01d3 (diff)
Allow non-SDK Java libraries to masquerade as <uses-library>.
Extend usesLibraryProperties with a boolean is_uses_lib property and move these properties from java.AndroidApp to java.Module to allow java.Library modules set the new propery and be recognized as <uses-library> by Soong. Bug: 132357300 Test: lunch cf_x86_phone-userdebug && m Change-Id: I01cd5e0da3dd543c1c0597249d37d0914b213ca7
Diffstat (limited to 'java/java.go')
-rw-r--r--java/java.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/java/java.go b/java/java.go
index 27e425dc1..22cf8c759 100644
--- a/java/java.go
+++ b/java/java.go
@@ -437,6 +437,7 @@ type Module struct {
hiddenAPI
dexer
dexpreopter
+ usesLibrary
linter
// list of the xref extraction files
@@ -452,6 +453,7 @@ func (j *Module) addHostProperties() {
j.AddProperties(
&j.properties,
&j.protoProperties,
+ &j.usesLibraryProperties,
)
}
@@ -1972,6 +1974,11 @@ func (j *Library) GenerateAndroidBuildActions(ctx android.ModuleContext) {
// added to the Android manifest.
j.exportedSdkLibs.MaybeAddLibraryPath(ctx, j.OptionalImplicitSdkLibrary(), j.DexJarBuildPath(), j.DexJarInstallPath())
+ // If this is a non-SDK uses-library, export itself.
+ if proptools.Bool(j.usesLibraryProperties.Is_uses_lib) {
+ j.exportedSdkLibs.AddLibraryPath(ctx, ctx.ModuleName(), j.DexJarBuildPath(), j.DexJarInstallPath())
+ }
+
j.distFiles = j.GenerateTaggedDistFiles(ctx)
}