diff options
author | Colin Cross <ccross@android.com> | 2017-12-11 16:29:02 -0800 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2017-12-11 16:30:14 -0800 |
commit | 366938f268c45ca002b2f3efa6d5e70e04a65ba6 (patch) | |
tree | 5a7558db839db59f86ecb353fed6abbe45cee6ff /java/java.go | |
parent | 9f319118e14989a0c9d3a3779eba1750bee7e002 (diff) |
Allow java manifest property to reference filegroups
Also factor out ExtractSourceDep and ExpandSource.
Test: m checkbuild
Change-Id: Ibc253514bc3109d84ec388a05c66b8108af5d6ab
Diffstat (limited to 'java/java.go')
-rw-r--r-- | java/java.go | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/java/java.go b/java/java.go index e9f833194..d9075b175 100644 --- a/java/java.go +++ b/java/java.go @@ -390,6 +390,7 @@ func (j *Module) deps(ctx android.BottomUpMutatorContext) { android.ExtractSourcesDeps(ctx, j.properties.Srcs) android.ExtractSourcesDeps(ctx, j.properties.Java_resources) + android.ExtractSourceDeps(ctx, j.properties.Manifest) if j.hasSrcExt(".proto") { protoDeps(ctx, &j.protoProperties) @@ -764,7 +765,10 @@ func (j *Module) compile(ctx android.ModuleContext, extraSrcJars ...android.Path // static classpath jars have the resources in them, so the resource jars aren't necessary here jars = append(jars, deps.staticJars...) - manifest := android.OptionalPathForModuleSrc(ctx, j.properties.Manifest) + var manifest android.OptionalPath + if j.properties.Manifest != nil { + manifest = android.OptionalPathForPath(ctx.ExpandSource(*j.properties.Manifest, "manifest")) + } // Combine the classes built from sources, any manifests, and any static libraries into // classes.jar. If there is only one input jar this step will be skipped. @@ -1088,14 +1092,8 @@ func (j *Binary) GenerateAndroidBuildActions(ctx android.ModuleContext) { // Handle the binary wrapper j.isWrapperVariant = true - if String(j.binaryProperties.Wrapper) != "" { - 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 - } + if j.binaryProperties.Wrapper != nil { + j.wrapperFile = ctx.ExpandSource(*j.binaryProperties.Wrapper, "wrapper") } else { j.wrapperFile = android.PathForSource(ctx, "build/soong/scripts/jar-wrapper.sh") } @@ -1113,7 +1111,7 @@ 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)}) + android.ExtractSourceDeps(ctx, j.binaryProperties.Wrapper) } } |