summaryrefslogtreecommitdiff
path: root/java/robolectric.go
diff options
context:
space:
mode:
authoralk3pInjection <webmaster@raspii.tech>2023-04-20 00:08:54 +0800
committeralk3pInjection <webmaster@raspii.tech>2023-04-20 00:08:54 +0800
commit923de58d67f7706e390551aa39c3c200100508b3 (patch)
treee7624ee1c43130597c12251dc0e93798bb853af8 /java/robolectric.go
parent3ba16183209cb452f73eb482cb04c1e7403c8586 (diff)
parent4993a08b8d37d5075ea0101a09ed9bbde4687ab9 (diff)
Merge tag 'LA.QSSI.13.0.r1-09800-qssi.0' into tachibanatachibana
"LA.QSSI.13.0.r1-09800-qssi.0" Change-Id: If5115134fea6c667ca1b5c8f50861ef9e3398842
Diffstat (limited to 'java/robolectric.go')
-rw-r--r--java/robolectric.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/java/robolectric.go b/java/robolectric.go
index f71952172..80be04612 100644
--- a/java/robolectric.go
+++ b/java/robolectric.go
@@ -23,6 +23,8 @@ import (
"android/soong/android"
"android/soong/java/config"
"android/soong/tradefed"
+
+ "github.com/google/blueprint/proptools"
)
func init() {
@@ -63,6 +65,10 @@ type robolectricProperties struct {
// The version number of a robolectric prebuilt to use from prebuilts/misc/common/robolectric
// instead of the one built from source in external/robolectric-shadows.
Robolectric_prebuilt_version *string
+
+ // Use /external/robolectric rather than /external/robolectric-shadows as the version of robolectri
+ // to use. /external/robolectric closely tracks github's master, and will fully replace /external/robolectric-shadows
+ Upstream *bool
}
type robolectricTest struct {
@@ -106,7 +112,11 @@ func (r *robolectricTest) DepsMutator(ctx android.BottomUpMutatorContext) {
if v := String(r.robolectricProperties.Robolectric_prebuilt_version); v != "" {
ctx.AddVariationDependencies(nil, libTag, fmt.Sprintf(robolectricPrebuiltLibPattern, v))
} else {
- ctx.AddVariationDependencies(nil, libTag, robolectricCurrentLib)
+ if proptools.Bool(r.robolectricProperties.Upstream) {
+ ctx.AddVariationDependencies(nil, libTag, robolectricCurrentLib+"_upstream")
+ } else {
+ ctx.AddVariationDependencies(nil, libTag, robolectricCurrentLib)
+ }
}
ctx.AddVariationDependencies(nil, libTag, robolectricDefaultLibs...)