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
diff --git a/java/gen.go b/java/gen.go
index dd86f66..6e8313a 100644
--- a/java/gen.go
+++ b/java/gen.go
@@ -20,7 +20,6 @@
import (
"path/filepath"
- "strings"
"github.com/google/blueprint"
"github.com/google/blueprint/pathtools"
@@ -63,7 +62,7 @@
)
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 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")