diff options
Diffstat (limited to 'java/java.go')
| -rw-r--r-- | java/java.go | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/java/java.go b/java/java.go index b343584a7..e00f681c5 100644 --- a/java/java.go +++ b/java/java.go @@ -511,11 +511,16 @@ func (j *Module) OutputFiles(tag string) (android.Paths, error) { var _ android.OutputFileProducer = (*Module)(nil) -type Dependency interface { +// Methods that need to be implemented for a module that is added to apex java_libs property. +type ApexDependency interface { HeaderJars() android.Paths + ImplementationAndResourcesJars() android.Paths +} + +type Dependency interface { + ApexDependency ImplementationJars() android.Paths ResourceJars() android.Paths - ImplementationAndResourcesJars() android.Paths DexJarBuildPath() android.Path DexJarInstallPath() android.Path AidlIncludeDirs() android.Paths @@ -616,7 +621,9 @@ type jniLib struct { } func (j *Module) shouldInstrument(ctx android.BaseModuleContext) bool { - return j.properties.Instrument && ctx.Config().IsEnvTrue("EMMA_INSTRUMENT") + return j.properties.Instrument && + ctx.Config().IsEnvTrue("EMMA_INSTRUMENT") && + ctx.DeviceConfig().JavaCoverageEnabledForPath(ctx.ModuleDir()) } func (j *Module) shouldInstrumentStatic(ctx android.BaseModuleContext) bool { @@ -1180,9 +1187,9 @@ func (j *Module) collectBuilderFlags(ctx android.ModuleContext, deps deps) javaB if flags.javaVersion.usesJavaModules() { javacFlags = append(javacFlags, j.properties.Openjdk9.Javacflags...) } - if ctx.Config().MinimizeJavaDebugInfo() { - // Override the -g flag passed globally to remove local variable debug info to reduce - // disk and memory usage. + if ctx.Config().MinimizeJavaDebugInfo() && !ctx.Host() { + // For non-host binaries, override the -g flag passed globally to remove + // local variable debug info to reduce disk and memory usage. javacFlags = append(javacFlags, "-g:source,lines") } javacFlags = append(javacFlags, "-Xlint:-dep-ann") |