Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c07abe9a authored by Rex Hoffman's avatar Rex Hoffman Committed by Automerger Merge Worker
Browse files
parents cae3f7df ebaac47e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -154,6 +154,7 @@ func createJavaDeviceForHostRules() []Rule {
		"development/build",
		"external/guava",
		"external/robolectric-shadows",
		"external/robolectric",
		"frameworks/layoutlib",
	}

+11 −1
Original line number Diff line number Diff line
@@ -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 {
@@ -105,9 +111,13 @@ 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 {
		if proptools.Bool(r.robolectricProperties.Upstream) {
			ctx.AddVariationDependencies(nil, libTag, robolectricCurrentLib+"_upstream")
		} else {
			ctx.AddVariationDependencies(nil, libTag, robolectricCurrentLib)
		}
	}

	ctx.AddVariationDependencies(nil, libTag, robolectricDefaultLibs...)