Remove jarSpec structure

It's not doing anything anymore, and the next patch will need more
complex jar arguments.  Just remove it.

Test: m -j checkbuild
Change-Id: I96d15995e86263ec04fd5c13ab0fd54d8b85c788
This commit is contained in:
Colin Cross
2017-09-27 17:41:35 -07:00
parent d689143f1d
commit 40a3671416
3 changed files with 12 additions and 24 deletions

View File

@@ -129,14 +129,6 @@ type javaBuilderFlags struct {
javaVersion string
}
type jarSpec struct {
fileList, dir android.Path
}
func (j jarSpec) soongJarArgs() string {
return "-C " + j.dir.String() + " -l " + j.fileList.String()
}
func TransformJavaToClasses(ctx android.ModuleContext, srcFiles, srcFileLists android.Paths,
flags javaBuilderFlags, deps android.Paths) android.ModuleOutPath {
@@ -206,18 +198,11 @@ func RunErrorProne(ctx android.ModuleContext, srcFiles android.Paths, srcFileLis
return classFileList
}
func TransformResourcesToJar(ctx android.ModuleContext, resources []jarSpec,
func TransformResourcesToJar(ctx android.ModuleContext, jarArgs []string,
deps android.Paths) android.Path {
outputFile := android.PathForModuleOut(ctx, "res.jar")
jarArgs := []string{}
for _, j := range resources {
deps = append(deps, j.fileList)
jarArgs = append(jarArgs, j.soongJarArgs())
}
ctx.ModuleBuild(pctx, android.ModuleBuildParams{
Rule: jar,
Description: "jar",

View File

@@ -426,10 +426,11 @@ func (j *Module) compile(ctx android.ModuleContext) {
jars = append(jars, classes)
}
resourceJarSpecs := ResourceDirsToJarSpecs(ctx, j.properties.Java_resource_dirs, j.properties.Exclude_java_resource_dirs)
if len(resourceJarSpecs) > 0 {
resArgs, resDeps := ResourceDirsToJarArgs(ctx, j.properties.Java_resource_dirs, j.properties.Exclude_java_resource_dirs)
if len(resArgs) > 0 {
// Combine classes + resources into classes-full-debug.jar
resourceJar := TransformResourcesToJar(ctx, resourceJarSpecs, extraJarDeps)
resourceJar := TransformResourcesToJar(ctx, resArgs, resDeps)
if ctx.Failed() {
return
}

View File

@@ -40,7 +40,8 @@ func isStringInSlice(str string, slice []string) bool {
return false
}
func ResourceDirsToJarSpecs(ctx android.ModuleContext, resourceDirs, excludeDirs []string) []jarSpec {
func ResourceDirsToJarArgs(ctx android.ModuleContext,
resourceDirs, excludeDirs []string) (args []string, deps android.Paths) {
var excludes []string
for _, exclude := range excludeDirs {
@@ -49,8 +50,6 @@ func ResourceDirsToJarSpecs(ctx android.ModuleContext, resourceDirs, excludeDirs
excludes = append(excludes, resourceExcludes...)
var jarSpecs []jarSpec
for _, resourceDir := range resourceDirs {
if isStringInSlice(resourceDir, excludeDirs) {
continue
@@ -63,9 +62,12 @@ func ResourceDirsToJarSpecs(ctx android.ModuleContext, resourceDirs, excludeDirs
pattern := filepath.Join(dir.String(), "**/*")
bootstrap.GlobFile(ctx, pattern, excludes, fileListFile.String(), depFile)
jarSpecs = append(jarSpecs, jarSpec{fileListFile, dir})
args = append(args,
"-C", dir.String(),
"-l", fileListFile.String())
deps = append(deps, fileListFile)
}
}
return jarSpecs
return args, deps
}