aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@google.com>2018-03-12 15:30:26 -0700
committerDan Willemsen <dwillemsen@google.com>2018-04-17 10:34:23 -0700
commit050ca73dbfdd360a209daf93a6f7d059a8705569 (patch)
tree3332693a54c93fb13b220f44ea3a5ea7e171a65a /java
parente9216117dd376aa48476c0ef448fcbd818961861 (diff)
downloadbuild_soong-050ca73dbfdd360a209daf93a6f7d059a8705569.tar.gz
build_soong-050ca73dbfdd360a209daf93a6f7d059a8705569.tar.bz2
build_soong-050ca73dbfdd360a209daf93a6f7d059a8705569.zip
Use Config/DeviceConfig functions to access ProductVariables
An upcoming change will stop exporting ProductVariables from Config, so switch to using existing accessor functions, and add more when they're missing. Bug: 76168832 Test: out/soong/build.ninja is identical Change-Id: Ie0135bdbd2df3258ef3ddb53e5f8fc00aa9b97f7 Merged-In: Ie0135bdbd2df3258ef3ddb53e5f8fc00aa9b97f7 (cherry picked from commit 3fb1faeeb98143e132ca4d6f1cac42d6f060888b)
Diffstat (limited to 'java')
-rw-r--r--java/app.go24
1 files changed, 3 insertions, 21 deletions
diff --git a/java/app.go b/java/app.go
index ac88df79..c94d22f0 100644
--- a/java/app.go
+++ b/java/app.go
@@ -362,15 +362,7 @@ func overlayResourceGlob(ctx android.ModuleContext, dir android.Path) (res []glo
overlayData := ctx.Config().Get(overlayDataKey).([]overlayGlobResult)
// Runtime resource overlays (RRO) may be turned on by the product config for some modules
- rroEnabled := false
- enforceRROTargets := ctx.Config().ProductVariables.EnforceRROTargets
- if enforceRROTargets != nil {
- if len(*enforceRROTargets) == 1 && (*enforceRROTargets)[0] == "*" {
- rroEnabled = true
- } else if inList(ctx.ModuleName(), *enforceRROTargets) {
- rroEnabled = true
- }
- }
+ rroEnabled := ctx.Config().EnforceRROForModule(ctx.ModuleName())
for _, data := range overlayData {
files := data.paths.PathsInDirectory(filepath.Join(data.dir, dir.String()))
@@ -400,13 +392,6 @@ func OverlaySingletonFactory() android.Singleton {
type overlaySingleton struct{}
func (overlaySingleton) GenerateBuildActions(ctx android.SingletonContext) {
-
- // Specific overlays may be excluded from Runtime Resource Overlays by the product config
- var rroExcludedOverlays []string
- if ctx.Config().ProductVariables.EnforceRROExcludedOverlays != nil {
- rroExcludedOverlays = *ctx.Config().ProductVariables.EnforceRROExcludedOverlays
- }
-
var overlayData []overlayGlobResult
overlayDirs := ctx.Config().ResourceOverlays()
for i := range overlayDirs {
@@ -417,11 +402,8 @@ func (overlaySingleton) GenerateBuildActions(ctx android.SingletonContext) {
result.dir = overlay
// Mark overlays that will not have Runtime Resource Overlays enforced on them
- for _, exclude := range rroExcludedOverlays {
- if strings.HasPrefix(overlay, exclude) {
- result.excludeFromRRO = true
- }
- }
+ // based on the product config
+ result.excludeFromRRO = ctx.Config().EnforceRROExcludedOverlay(overlay)
files, err := ctx.GlobWithDeps(filepath.Join(overlay, "**/*"), aaptIgnoreFilenames)
if err != nil {