diff options
author | Anton Hansson <hansson@google.com> | 2020-03-30 23:17:15 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2020-03-30 23:17:15 +0000 |
commit | 84dc13b8de7f666bf82b8ced76096054b654d6d8 (patch) | |
tree | 85a734fa8c4086306ebb187e9bab715233e39eec /java/java.go | |
parent | 6d5d8a6d6a0a1a9dad8b70a50d8e3195bfefc0b7 (diff) | |
parent | 1e65f94a4b2cc7dea1896937c2068b87c899c465 (diff) | |
download | build_soong-84dc13b8de7f666bf82b8ced76096054b654d6d8.tar.gz build_soong-84dc13b8de7f666bf82b8ced76096054b654d6d8.tar.bz2 build_soong-84dc13b8de7f666bf82b8ced76096054b654d6d8.zip |
Merge "Add a Tag field to dist to dist a tagged output" into rvc-dev
Diffstat (limited to 'java/java.go')
-rw-r--r-- | java/java.go | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/java/java.go b/java/java.go index 55ad8b01..d67ff874 100644 --- a/java/java.go +++ b/java/java.go @@ -419,6 +419,8 @@ type Module struct { // list of the xref extraction files kytheFiles android.Paths + + distFile android.Path } func (j *Module) OutputFiles(tag string) (android.Paths, error) { @@ -1776,9 +1778,18 @@ func (j *Module) IsInstallable() bool { // Java libraries (.jar file) // +type LibraryProperties struct { + Dist struct { + // The tag of the output of this module that should be output. + Tag *string `android:"arch_variant"` + } `android:"arch_variant"` +} + type Library struct { Module + libraryProperties LibraryProperties + InstallMixin func(ctx android.ModuleContext, installPath android.Path) (extraInstallDeps android.Paths) } @@ -1822,6 +1833,15 @@ func (j *Library) GenerateAndroidBuildActions(ctx android.ModuleContext) { j.installFile = ctx.InstallFile(android.PathForModuleInstall(ctx, "framework"), ctx.ModuleName()+".jar", j.outputFile, extraInstallDeps...) } + + // Verify Dist.Tag is set to a supported output + if j.libraryProperties.Dist.Tag != nil { + distFiles, err := j.OutputFiles(*j.libraryProperties.Dist.Tag) + if err != nil { + ctx.PropertyErrorf("dist.tag", "%s", err.Error()) + } + j.distFile = distFiles[0] + } } func (j *Library) DepsMutator(ctx android.BottomUpMutatorContext) { @@ -1946,7 +1966,8 @@ func LibraryFactory() android.Module { &module.Module.properties, &module.Module.deviceProperties, &module.Module.dexpreoptProperties, - &module.Module.protoProperties) + &module.Module.protoProperties, + &module.libraryProperties) android.InitApexModule(module) android.InitSdkAwareModule(module) |