From b77043e20702557ced6f3e57c4dbbc392065ed76 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Tue, 16 Jul 2019 13:57:13 -0700 Subject: Add a systemModules utility type Storing system modules in a classpath is clumsy, as there should only ever be one system modules, and it needs to store both a directory to pass as the argument and a set of generated files to use as dependencies. Store them in a separate systemModules type instead. Test: m checkbuild Change-Id: I020556c736bd5091865bcca51dc0fb9e4db6b45b --- java/java.go | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'java/java.go') diff --git a/java/java.go b/java/java.go index a49aad775..f3e10bebd 100644 --- a/java/java.go +++ b/java/java.go @@ -632,8 +632,7 @@ type deps struct { aidlIncludeDirs android.Paths srcs android.Paths srcJars android.Paths - systemModules android.Path - systemModulesDeps android.Paths + systemModules *systemModules aidlPreprocess android.OptionalPath kotlinStdlib android.Paths kotlinAnnotations android.Paths @@ -844,8 +843,7 @@ func (j *Module) collectDeps(ctx android.ModuleContext) deps { if sm.outputDir == nil || len(sm.outputDeps) == 0 { panic("Missing directory for system module dependency") } - deps.systemModules = sm.outputDir - deps.systemModulesDeps = sm.outputDeps + deps.systemModules = &systemModules{sm.outputDir, sm.outputDeps} } } }) @@ -973,10 +971,7 @@ func (j *Module) collectBuilderFlags(ctx android.ModuleContext, deps deps) javaB } // systemModules - if deps.systemModules != nil { - flags.systemModules = append(flags.systemModules, deps.systemModules) - flags.systemModulesDeps = append(flags.systemModulesDeps, deps.systemModulesDeps...) - } + flags.systemModules = deps.systemModules // aidl flags. flags.aidlFlags, flags.aidlDeps = j.aidlFlags(ctx, deps.aidlPreprocess, deps.aidlIncludeDirs) -- cgit v1.2.3-59-g8ed1b