summaryrefslogtreecommitdiff
path: root/java/base.go
diff options
context:
space:
mode:
Diffstat (limited to 'java/base.go')
-rw-r--r--java/base.go26
1 files changed, 15 insertions, 11 deletions
diff --git a/java/base.go b/java/base.go
index 32bfc17f9..fc21c44e5 100644
--- a/java/base.go
+++ b/java/base.go
@@ -218,11 +218,15 @@ type CommonProperties struct {
// the stubs via static libs.
Is_stubs_module *bool
- // If true, enable the "Ravenizer" tool on the output jar.
- // "Ravenizer" is a tool for Ravenwood tests, but it can also be enabled on other kinds
- // of java targets.
Ravenizer struct {
+ // If true, enable the "Ravenizer" tool on the output jar.
+ // "Ravenizer" is a tool for Ravenwood tests, but it can also be enabled on other kinds
+ // of java targets.
Enabled *bool
+
+ // If true, the "Ravenizer" tool will remove all Mockito and DexMaker
+ // classes from the output jar.
+ Strip_mockito *bool
}
// Contributing api surface of the stub module. Is not visible to bp modules, and should
@@ -1134,8 +1138,9 @@ func (j *Module) compile(ctx android.ModuleContext, extraSrcJars, extraClasspath
j.exportAidlIncludeDirs = android.PathsForModuleSrc(ctx, j.deviceProperties.Aidl.Export_include_dirs)
- if re := proptools.Bool(j.properties.Ravenizer.Enabled); re {
- j.ravenizer.enabled = re
+ // Only override the original value if explicitly set
+ if j.properties.Ravenizer.Enabled != nil {
+ j.ravenizer.enabled = *j.properties.Ravenizer.Enabled
}
deps := j.collectDeps(ctx)
@@ -1624,12 +1629,11 @@ func (j *Module) compile(ctx android.ModuleContext, extraSrcJars, extraClasspath
if j.ravenizer.enabled {
ravenizerInput := outputFile
ravenizerOutput := android.PathForModuleOut(ctx, "ravenizer", jarName)
- ctx.Build(pctx, android.BuildParams{
- Rule: ravenizer,
- Description: "ravenizer",
- Input: ravenizerInput,
- Output: ravenizerOutput,
- })
+ ravenizerArgs := ""
+ if proptools.Bool(j.properties.Ravenizer.Strip_mockito) {
+ ravenizerArgs = "--strip-mockito"
+ }
+ TransformRavenizer(ctx, ravenizerOutput, ravenizerInput, ravenizerArgs)
outputFile = ravenizerOutput
localImplementationJars = android.Paths{ravenizerOutput}
completeStaticLibsImplementationJars = android.NewDepSet(android.PREORDER, localImplementationJars, nil)