aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2015-07-14 18:55:36 -0700
committerColin Cross <ccross@android.com>2015-08-24 16:19:43 -0700
commit6e18ca49f83c18772299677a4bd949d9dc978a62 (patch)
treecec6aeef53c5235ca63082aa5528c89f0783db1a /java
parentcbac5fbe78bb7162049744e6aad234d572e2cab6 (diff)
downloadbuild_soong-6e18ca49f83c18772299677a4bd949d9dc978a62.tar.gz
build_soong-6e18ca49f83c18772299677a4bd949d9dc978a62.tar.bz2
build_soong-6e18ca49f83c18772299677a4bd949d9dc978a62.zip
Fix java resource glob file list location
The source path was being appended to the module out directory to create the file list file, which was resulting in .. in the source path moving the file list file up the directory tree. Use SrcDirRelPath to convert the globbed resource directories to be relatiave to $srcDir before appending them. Also do the same fix to generated aidl, logtags, yacc, and lex files. Change-Id: I2e636bd30abf03bc1d80a897951a9812cc3e09ef
Diffstat (limited to 'java')
-rw-r--r--java/gen.go5
-rw-r--r--java/resources.go3
2 files changed, 4 insertions, 4 deletions
diff --git a/java/gen.go b/java/gen.go
index dd86f66f..6e8313a9 100644
--- a/java/gen.go
+++ b/java/gen.go
@@ -20,7 +20,6 @@ package java
import (
"path/filepath"
- "strings"
"github.com/google/blueprint"
"github.com/google/blueprint/pathtools"
@@ -63,7 +62,7 @@ var (
)
func genAidl(ctx common.AndroidModuleContext, aidlFile, aidlFlags string) string {
- javaFile := strings.TrimPrefix(aidlFile, common.ModuleSrcDir(ctx))
+ javaFile := common.SrcDirRelPath(ctx, aidlFile)
javaFile = filepath.Join(common.ModuleGenDir(ctx), javaFile)
javaFile = pathtools.ReplaceExtension(javaFile, "java")
depFile := javaFile + ".d"
@@ -83,7 +82,7 @@ func genAidl(ctx common.AndroidModuleContext, aidlFile, aidlFlags string) string
}
func genLogtags(ctx common.AndroidModuleContext, logtagsFile string) string {
- javaFile := strings.TrimPrefix(logtagsFile, common.ModuleSrcDir(ctx))
+ javaFile := common.SrcDirRelPath(ctx, logtagsFile)
javaFile = filepath.Join(common.ModuleGenDir(ctx), javaFile)
javaFile = pathtools.ReplaceExtension(javaFile, "java")
diff --git a/java/resources.go b/java/resources.go
index 995e60df..405d8b05 100644
--- a/java/resources.go
+++ b/java/resources.go
@@ -56,7 +56,8 @@ func ResourceDirsToJarSpecs(ctx common.AndroidModuleContext, resourceDirs, exclu
resourceDir := filepath.Join(common.ModuleSrcDir(ctx), resourceDir)
dirs := ctx.Glob("java_resources", resourceDir, nil)
for _, dir := range dirs {
- fileListFile := filepath.Join(common.ModuleOutDir(ctx), "res", dir, "resources.list")
+ relDir := common.SrcDirRelPath(ctx, dir)
+ fileListFile := filepath.Join(common.ModuleOutDir(ctx), "res", relDir, "resources.list")
depFile := fileListFile + ".d"
glob := filepath.Join(dir, "**/*")