summaryrefslogtreecommitdiff
path: root/java/java.go
diff options
context:
space:
mode:
authorPaul Duffin <paulduffin@google.com>2020-06-26 20:11:30 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-06-26 20:11:30 +0000
commit420c026efdcc37124ddfed1f7a08e0024b924741 (patch)
treeeb40a611c4cece07213497fcb235de3cc9ab5896 /java/java.go
parentb3442a04b3659aa35eb64be7a6c16a90dff68d60 (diff)
parentc4422106a7cf4731e27d664646bc0d57ad3f37fa (diff)
Apply hiddenapi encoding to java_sdk_library .impl am: c4422106a7
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/11988739 Change-Id: I9e257b70bc401b8b69273c787b74d0f4c04870f1
Diffstat (limited to 'java/java.go')
-rw-r--r--java/java.go15
1 files changed, 14 insertions, 1 deletions
diff --git a/java/java.go b/java/java.go
index 42e40b9a3..e1a7a6646 100644
--- a/java/java.go
+++ b/java/java.go
@@ -342,6 +342,12 @@ type CompilerDeviceProperties struct {
// otherwise provides defaults libraries to add to the bootclasspath.
System_modules *string
+ // The name of the module as used in build configuration.
+ //
+ // Allows a library to separate its actual name from the name used in
+ // build configuration, e.g.ctx.Config().BootJars().
+ ConfigurationName *string `blueprint:"mutated"`
+
// set the name of the output
Stem *string
@@ -1635,8 +1641,11 @@ func (j *Module) compile(ctx android.ModuleContext, aaptSrcJar android.Path) {
return
}
+ configurationName := j.ConfigurationName()
+ primary := configurationName == ctx.ModuleName()
+
// Hidden API CSV generation and dex encoding
- dexOutputFile = j.hiddenAPI.hiddenAPI(ctx, dexOutputFile, j.implementationJarFile,
+ dexOutputFile = j.hiddenAPI.hiddenAPI(ctx, configurationName, primary, dexOutputFile, j.implementationJarFile,
proptools.Bool(j.deviceProperties.Uncompress_dex))
// merge dex jar with resources if necessary
@@ -1913,6 +1922,10 @@ func (j *Module) Stem() string {
return proptools.StringDefault(j.deviceProperties.Stem, j.Name())
}
+func (j *Module) ConfigurationName() string {
+ return proptools.StringDefault(j.deviceProperties.ConfigurationName, j.BaseModuleName())
+}
+
func (j *Module) JacocoReportClassesFile() android.Path {
return j.jacocoReportClassesFile
}