aboutsummaryrefslogtreecommitdiffstats
path: root/cc/gen.go
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 /cc/gen.go
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 'cc/gen.go')
-rw-r--r--cc/gen.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/cc/gen.go b/cc/gen.go
index bd91d647..3bfe679d 100644
--- a/cc/gen.go
+++ b/cc/gen.go
@@ -20,7 +20,6 @@ package cc
import (
"path/filepath"
- "strings"
"github.com/google/blueprint"
"github.com/google/blueprint/pathtools"
@@ -51,7 +50,7 @@ var (
)
func genYacc(ctx common.AndroidModuleContext, yaccFile, yaccFlags string) (cppFile, headerFile string) {
- cppFile = strings.TrimPrefix(yaccFile, common.ModuleSrcDir(ctx))
+ cppFile = common.SrcDirRelPath(ctx, yaccFile)
cppFile = filepath.Join(common.ModuleGenDir(ctx), cppFile)
cppFile = pathtools.ReplaceExtension(cppFile, "cpp")
hppFile := pathtools.ReplaceExtension(cppFile, "hpp")
@@ -74,7 +73,7 @@ func genYacc(ctx common.AndroidModuleContext, yaccFile, yaccFlags string) (cppFi
}
func genLex(ctx common.AndroidModuleContext, lexFile string) (cppFile string) {
- cppFile = strings.TrimPrefix(lexFile, common.ModuleSrcDir(ctx))
+ cppFile = common.SrcDirRelPath(ctx, lexFile)
cppFile = filepath.Join(common.ModuleGenDir(ctx), cppFile)
cppFile = pathtools.ReplaceExtension(cppFile, "cpp")