summaryrefslogtreecommitdiff
path: root/java/base.go
diff options
context:
space:
mode:
author Treehugger Robot <treehugger-gerrit@google.com> 2022-01-11 08:11:46 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2022-01-11 08:11:46 +0000
commitd887d9b45241788afbcd32c3480980e43c55665e (patch)
tree5365af5b202f0abc2a724b531a2467682b63ba45 /java/base.go
parent2715e898c5af3d4f998c56824d95ac7cb929808f (diff)
parentf7e9e1f434e2604761e485f2a9d1b34c10f402e2 (diff)
Merge changes I9ad66ea2,I4c95b77b am: 57271b9f45 am: a7c0107744 am: 16213c6bbe am: f7e9e1f434
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1934955 Change-Id: I5e05dbd3bca3c14bb52ad383c8af3eaf491222a1
Diffstat (limited to 'java/base.go')
-rw-r--r--java/base.go17
1 files changed, 13 insertions, 4 deletions
diff --git a/java/base.go b/java/base.go
index 7cd71a270..bc8da9a77 100644
--- a/java/base.go
+++ b/java/base.go
@@ -253,9 +253,6 @@ type DeviceProperties struct {
// otherwise provides defaults libraries to add to the bootclasspath.
System_modules *string
- // set the name of the output
- Stem *string
-
IsSDKLibrary bool `blueprint:"mutated"`
// If true, generate the signature file of APK Signing Scheme V4, along side the signed APK file.
@@ -267,6 +264,15 @@ type DeviceProperties struct {
SyspropPublicStub string `blueprint:"mutated"`
}
+// Device properties that can be overridden by overriding module (e.g. override_android_app)
+type OverridableDeviceProperties struct {
+ // set the name of the output. If not set, `name` is used.
+ // To override a module with this property set, overriding module might need to set this as well.
+ // Otherwise, both the overridden and the overriding modules will have the same output name, which
+ // can cause the duplicate output error.
+ Stem *string
+}
+
// Functionality common to Module and Import
//
// It is embedded in Module so its functionality can be used by methods in Module
@@ -389,6 +395,8 @@ type Module struct {
protoProperties android.ProtoProperties
deviceProperties DeviceProperties
+ overridableDeviceProperties OverridableDeviceProperties
+
// jar file containing header classes including static library dependencies, suitable for
// inserting into the bootclasspath/classpath of another compile
headerJarFile android.Path
@@ -544,6 +552,7 @@ func (j *Module) addHostAndDeviceProperties() {
j.addHostProperties()
j.AddProperties(
&j.deviceProperties,
+ &j.overridableDeviceProperties,
&j.dexer.dexProperties,
&j.dexpreoptProperties,
&j.linter.properties,
@@ -1671,7 +1680,7 @@ func (j *Module) ShouldSupportSdkVersion(ctx android.BaseModuleContext, sdkVersi
}
func (j *Module) Stem() string {
- return proptools.StringDefault(j.deviceProperties.Stem, j.Name())
+ return proptools.StringDefault(j.overridableDeviceProperties.Stem, j.Name())
}
func (j *Module) JacocoReportClassesFile() android.Path {