diff options
Diffstat (limited to 'java/java.go')
| -rw-r--r-- | java/java.go | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/java/java.go b/java/java.go index 7ecf6720f..f9a4c04d2 100644 --- a/java/java.go +++ b/java/java.go @@ -466,6 +466,11 @@ func (j *Module) collectBuilderFlags(ctx android.ModuleContext, deps deps) javaB if ctx.AConfig().TargetOpenJDK9() { javacFlags = append(javacFlags, j.properties.Openjdk9.Javacflags...) } + if ctx.AConfig().MinimizeJavaDebugInfo() { + // Override the -g flag passed globally to remove local variable debug info to reduce + // disk and memory usage. + javacFlags = append(javacFlags, "-g:source,lines") + } if len(javacFlags) > 0 { // optimization. ctx.Variable(pctx, "javacFlags", strings.Join(javacFlags, " ")) @@ -864,7 +869,7 @@ type Binary struct { binaryProperties binaryProperties - wrapperFile android.ModuleSrcPath + wrapperFile android.SourcePath binaryFile android.OutputPath } @@ -877,7 +882,11 @@ func (j *Binary) GenerateAndroidBuildActions(ctx android.ModuleContext) { // Depend on the installed jar (j.installFile) so that the wrapper doesn't get executed by // another build rule before the jar has been installed. - j.wrapperFile = android.PathForModuleSrc(ctx, j.binaryProperties.Wrapper) + if j.binaryProperties.Wrapper != "" { + j.wrapperFile = android.PathForModuleSrc(ctx, j.binaryProperties.Wrapper).SourcePath + } else { + j.wrapperFile = android.PathForSource(ctx, "build/soong/scripts/jar-wrapper.sh") + } j.binaryFile = ctx.InstallExecutable(android.PathForModuleInstall(ctx, "bin"), ctx.ModuleName(), j.wrapperFile, j.installFile) } |