Enable new_robolectric am: ebaac47e4e
am: c07abe9ad2
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/20387913 Change-Id: I57f613dd82abe7fc0132572028c43a44bf00e114 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -155,6 +155,7 @@ func createJavaDeviceForHostRules() []Rule {
|
|||||||
"external/guava",
|
"external/guava",
|
||||||
"external/kotlinx.coroutines",
|
"external/kotlinx.coroutines",
|
||||||
"external/robolectric-shadows",
|
"external/robolectric-shadows",
|
||||||
|
"external/robolectric",
|
||||||
"frameworks/layoutlib",
|
"frameworks/layoutlib",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -23,6 +23,8 @@ import (
|
|||||||
"android/soong/android"
|
"android/soong/android"
|
||||||
"android/soong/java/config"
|
"android/soong/java/config"
|
||||||
"android/soong/tradefed"
|
"android/soong/tradefed"
|
||||||
|
|
||||||
|
"github.com/google/blueprint/proptools"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@@ -63,6 +65,10 @@ type robolectricProperties struct {
|
|||||||
// The version number of a robolectric prebuilt to use from prebuilts/misc/common/robolectric
|
// 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.
|
// instead of the one built from source in external/robolectric-shadows.
|
||||||
Robolectric_prebuilt_version *string
|
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 {
|
type robolectricTest struct {
|
||||||
@@ -106,7 +112,11 @@ func (r *robolectricTest) DepsMutator(ctx android.BottomUpMutatorContext) {
|
|||||||
if v := String(r.robolectricProperties.Robolectric_prebuilt_version); v != "" {
|
if v := String(r.robolectricProperties.Robolectric_prebuilt_version); v != "" {
|
||||||
ctx.AddVariationDependencies(nil, libTag, fmt.Sprintf(robolectricPrebuiltLibPattern, v))
|
ctx.AddVariationDependencies(nil, libTag, fmt.Sprintf(robolectricPrebuiltLibPattern, v))
|
||||||
} else {
|
} 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...)
|
ctx.AddVariationDependencies(nil, libTag, robolectricDefaultLibs...)
|
||||||
|
Reference in New Issue
Block a user