From 8a49795df1ed87a4889f267dbd8d28c5832bb897 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Tue, 5 Mar 2019 22:25:09 -0800 Subject: Replace ctx.ExpandSources with android.PathsForModuleSrc Move the logic from ctx.ExpandSources into android.PathsForModuleSrc and ctx.ExpandSource into android.PathForModuleSrc, and deprecate them. When combined with the pathDepsMutator this will let all properties that take source paths also take filegroups or genrule outputs, as long as they are tagged with `android:"path"`. Test: All soong tests Change-Id: I01625e76b5da19240e9649bf26a014eeeafcab8f --- java/java.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'java/java.go') diff --git a/java/java.go b/java/java.go index 986e42503..e0da00636 100644 --- a/java/java.go +++ b/java/java.go @@ -942,7 +942,7 @@ func (j *Module) compile(ctx android.ModuleContext, extraSrcJars ...android.Path if flags.javaVersion == "1.9" { j.properties.Srcs = append(j.properties.Srcs, j.properties.Openjdk9.Srcs...) } - srcFiles := ctx.ExpandSources(j.properties.Srcs, j.properties.Exclude_srcs) + srcFiles := android.PathsForModuleSrcExcludes(ctx, j.properties.Srcs, j.properties.Exclude_srcs) if hasSrcExt(srcFiles.Strings(), ".proto") { flags = protoFlags(ctx, &j.properties, &j.protoProperties, flags) } @@ -958,7 +958,7 @@ func (j *Module) compile(ctx android.ModuleContext, extraSrcJars ...android.Path j.expandIDEInfoCompiledSrcs = append(j.expandIDEInfoCompiledSrcs, srcFiles.Strings()...) if j.properties.Jarjar_rules != nil { - j.expandJarjarRules = ctx.ExpandSource(*j.properties.Jarjar_rules, "jarjar_rules") + j.expandJarjarRules = android.PathForModuleSrc(ctx, *j.properties.Jarjar_rules) } jarName := ctx.ModuleName() + ".jar" @@ -1133,10 +1133,10 @@ func (j *Module) compile(ctx android.ModuleContext, extraSrcJars ...android.Path manifest := j.overrideManifest if !manifest.Valid() && j.properties.Manifest != nil { - manifest = android.OptionalPathForPath(ctx.ExpandSource(*j.properties.Manifest, "manifest")) + manifest = android.OptionalPathForPath(android.PathForModuleSrc(ctx, *j.properties.Manifest)) } - services := ctx.ExpandSources(j.properties.Services, nil) + services := android.PathsForModuleSrc(ctx, j.properties.Services) if len(services) > 0 { servicesJar := android.PathForModuleOut(ctx, "services", jarName) var zipargs []string @@ -1547,7 +1547,7 @@ type Test struct { func (j *Test) GenerateAndroidBuildActions(ctx android.ModuleContext) { j.testConfig = tradefed.AutoGenJavaTestConfig(ctx, j.testProperties.Test_config, j.testProperties.Test_config_template, j.testProperties.Test_suites) - j.data = ctx.ExpandSources(j.testProperties.Data, nil) + j.data = android.PathsForModuleSrc(ctx, j.testProperties.Data) j.Library.GenerateAndroidBuildActions(ctx) } @@ -1641,7 +1641,7 @@ func (j *Binary) GenerateAndroidBuildActions(ctx android.ModuleContext) { j.isWrapperVariant = true if j.binaryProperties.Wrapper != nil { - j.wrapperFile = ctx.ExpandSource(*j.binaryProperties.Wrapper, "wrapper") + j.wrapperFile = android.PathForModuleSrc(ctx, *j.binaryProperties.Wrapper) } else { j.wrapperFile = android.PathForSource(ctx, "build/soong/scripts/jar-wrapper.sh") } @@ -1765,7 +1765,7 @@ func (j *Import) DepsMutator(ctx android.BottomUpMutatorContext) { } func (j *Import) GenerateAndroidBuildActions(ctx android.ModuleContext) { - jars := ctx.ExpandSources(j.properties.Jars, nil) + jars := android.PathsForModuleSrc(ctx, j.properties.Jars) jarName := ctx.ModuleName() + ".jar" outputFile := android.PathForModuleOut(ctx, "combined", jarName) -- cgit v1.2.3-59-g8ed1b