diff options
author | 2025-01-10 15:37:01 -0800 | |
---|---|---|
committer | 2025-01-10 15:50:42 -0800 | |
commit | c7315286bb3abf2a7706400211dccd5e1eaa90ad (patch) | |
tree | 637768f88e468bdfc3ced99dab1482cce02ac385 /java/robolectric.go | |
parent | 52181d5bd9df148e02fd86e166ea00e10852201b (diff) |
_test module types shouldn't override user-set test property
Android lint considers code "test" code depending on if the --test flag
is passed. We pass it by default for *_test module types, but also allow
the user to control it via the "lint: { test: true }" property. However,
the module types were overriding the user-defined test property if
the user-defined one was supplied via a defaults module. Split the
test property into two so that modules can use a separate lower priority
one from the user-controlled one.
Fixes: 358643466
Test: m nothing --no-skip-soong-tests
Change-Id: I1b1ef7a73ca9f413aa29e0c6025134fc52dc7caf
Diffstat (limited to 'java/robolectric.go')
-rw-r--r-- | java/robolectric.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/java/robolectric.go b/java/robolectric.go index 6c137ba47..0d18ddf1c 100644 --- a/java/robolectric.go +++ b/java/robolectric.go @@ -20,6 +20,7 @@ import ( "android/soong/android" "android/soong/java/config" "android/soong/tradefed" + "github.com/google/blueprint" "github.com/google/blueprint/proptools" ) @@ -104,8 +105,6 @@ func (r *robolectricTest) TestSuites() []string { var _ android.TestSuiteModule = (*robolectricTest)(nil) - - func (r *robolectricTest) DepsMutator(ctx android.BottomUpMutatorContext) { r.Library.DepsMutator(ctx) @@ -294,7 +293,7 @@ func RobolectricTestFactory() android.Module { &module.testProperties) module.Module.dexpreopter.isTest = true - module.Module.linter.properties.Lint.Test = proptools.BoolPtr(true) + module.Module.linter.properties.Lint.Test_module_type = proptools.BoolPtr(true) module.testProperties.Test_suites = []string{"robolectric-tests"} |