summaryrefslogtreecommitdiff
path: root/java/java.go
diff options
context:
space:
mode:
author Treehugger Robot <treehugger-gerrit@google.com> 2017-12-11 23:55:57 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2017-12-11 23:55:57 +0000
commitd4c03092cd04e1c2963e5cbf3fd6b79c6fe2d330 (patch)
treeee9b80aee0cb8f25eb7dacd40913ce652319ae2a /java/java.go
parent75f2e70dff9fc549d9b08e512b965b71a14ed621 (diff)
parent31603067b0cc7c67f56c3d7415c886a17b4e6d24 (diff)
Merge changes I13910647,Ie061e90c,I1c1cb098
* changes: Escape genrule commands Allow java binary wrapper files to reference filegroups Allow globs in tool_files
Diffstat (limited to 'java/java.go')
-rw-r--r--java/java.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/java/java.go b/java/java.go
index 3663253c1..c2b039e88 100644
--- a/java/java.go
+++ b/java/java.go
@@ -1031,7 +1031,7 @@ type Binary struct {
isWrapperVariant bool
- wrapperFile android.SourcePath
+ wrapperFile android.Path
binaryFile android.OutputPath
}
@@ -1048,7 +1048,13 @@ func (j *Binary) GenerateAndroidBuildActions(ctx android.ModuleContext) {
j.isWrapperVariant = true
if String(j.binaryProperties.Wrapper) != "" {
- j.wrapperFile = android.PathForModuleSrc(ctx, String(j.binaryProperties.Wrapper)).SourcePath
+ wrapperSrcs := ctx.ExpandSources([]string{String(j.binaryProperties.Wrapper)}, nil)
+ if len(wrapperSrcs) == 1 {
+ j.wrapperFile = wrapperSrcs[0]
+ } else {
+ ctx.PropertyErrorf("wrapper", "module providing wrapper must produce exactly one file")
+ return
+ }
} else {
j.wrapperFile = android.PathForSource(ctx, "build/soong/scripts/jar-wrapper.sh")
}
@@ -1065,6 +1071,8 @@ func (j *Binary) GenerateAndroidBuildActions(ctx android.ModuleContext) {
func (j *Binary) DepsMutator(ctx android.BottomUpMutatorContext) {
if ctx.Arch().ArchType == android.Common {
j.deps(ctx)
+ } else {
+ android.ExtractSourcesDeps(ctx, []string{String(j.binaryProperties.Wrapper)})
}
}