summaryrefslogtreecommitdiff
path: root/java/java.go
diff options
context:
space:
mode:
author Colin Cross <ccross@android.com> 2017-12-08 19:12:36 -0800
committer Colin Cross <ccross@android.com> 2017-12-11 23:54:35 +0000
commitc331599a8878bfe40f6030ce5cfc10603f739a8d (patch)
treebc2f8a5c5a7e10dcfae3922c9ee4b7f5dbf1e9a8 /java/java.go
parentac87c992bee5c4034fdd5ced05e3328f081a7132 (diff)
Allow java binary wrapper files to reference filegroups
Also allow commands with no tools for the case when standard shell utilities are used to munge an input file. Test: m checkbuild Change-Id: Ie061e90cafe1a0a0db004a89e9a17fb48709cb03
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)})
}
}