Add default jar wrapper when wrapper property is not specified

Bug: b/68779881
Test: manually copied the jar-wrapper.sh to out/soong/host/linux-x86/framework
Change-Id: Idee1e7e64c6e3c89c89a8cd9c107a38533356b6c
This commit is contained in:
Nan Zhang
2017-11-03 14:53:31 -07:00
parent f45c6934c8
commit 3c807db06e
2 changed files with 64 additions and 2 deletions

View File

@@ -869,7 +869,7 @@ type Binary struct {
binaryProperties binaryProperties
wrapperFile android.ModuleSrcPath
wrapperFile android.SourcePath
binaryFile android.OutputPath
}
@@ -882,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)
}