aboutsummaryrefslogtreecommitdiffstats
path: root/android
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2017-02-01 14:07:55 -0800
committerColin Cross <ccross@android.com>2017-02-01 15:14:31 -0800
commit7fc17dbfcec0f21f11ee04503ed72bcd1c181866 (patch)
tree5a2c95f013244fc52ba38e8a1fc9f0d3b0fd22b5 /android
parente25bc9ba83c5d00a95aa06bda668e731f740a656 (diff)
downloadbuild_soong-7fc17dbfcec0f21f11ee04503ed72bcd1c181866.tar.gz
build_soong-7fc17dbfcec0f21f11ee04503ed72bcd1c181866.tar.bz2
build_soong-7fc17dbfcec0f21f11ee04503ed72bcd1c181866.zip
Remove extra basePath from ModuleSrcPath
ModuleSrcPath contains an embedded basePath as well as a SoucePath that contains another basePath. Remove the embedded basePath, and make the SourcePath embedded. Test: no change to build.ninja Change-Id: I3cdf3477eca41ed35fac08a892aab22cbcdb2224
Diffstat (limited to 'android')
-rw-r--r--android/paths.go16
1 files changed, 5 insertions, 11 deletions
diff --git a/android/paths.go b/android/paths.go
index e76e1fe6..8eabfb84 100644
--- a/android/paths.go
+++ b/android/paths.go
@@ -437,7 +437,7 @@ func (p SourcePath) Join(ctx PathContext, paths ...string) SourcePath {
func (p SourcePath) OverlayPath(ctx ModuleContext, path Path) OptionalPath {
var relDir string
if moduleSrcPath, ok := path.(ModuleSrcPath); ok {
- relDir = moduleSrcPath.sourcePath.path
+ relDir = moduleSrcPath.path
} else if srcPath, ok := path.(SourcePath); ok {
relDir = srcPath.path
} else {
@@ -507,9 +507,7 @@ func PathForIntermediates(ctx PathContext, paths ...string) OutputPath {
// ModuleSrcPath is a Path representing a file rooted from a module's local source dir
type ModuleSrcPath struct {
- basePath
- sourcePath SourcePath
- moduleDir string
+ SourcePath
}
var _ Path = ModuleSrcPath{}
@@ -521,7 +519,7 @@ var _ resPathProvider = ModuleSrcPath{}
// module's local source directory.
func PathForModuleSrc(ctx ModuleContext, paths ...string) ModuleSrcPath {
path := validatePath(ctx, paths...)
- return ModuleSrcPath{basePath{path, ctx.AConfig()}, PathForSource(ctx, ctx.ModuleDir(), path), ctx.ModuleDir()}
+ return ModuleSrcPath{PathForSource(ctx, ctx.ModuleDir(), path)}
}
// OptionalPathForModuleSrc returns an OptionalPath. The OptionalPath contains a
@@ -533,16 +531,12 @@ func OptionalPathForModuleSrc(ctx ModuleContext, p *string) OptionalPath {
return OptionalPathForPath(PathForModuleSrc(ctx, *p))
}
-func (p ModuleSrcPath) String() string {
- return p.sourcePath.String()
-}
-
func (p ModuleSrcPath) genPathWithExt(ctx ModuleContext, subdir, ext string) ModuleGenPath {
- return PathForModuleGen(ctx, subdir, p.moduleDir, pathtools.ReplaceExtension(p.path, ext))
+ return PathForModuleGen(ctx, subdir, pathtools.ReplaceExtension(p.path, ext))
}
func (p ModuleSrcPath) objPathWithExt(ctx ModuleContext, subdir, ext string) ModuleObjPath {
- return PathForModuleObj(ctx, subdir, p.moduleDir, pathtools.ReplaceExtension(p.path, ext))
+ return PathForModuleObj(ctx, subdir, pathtools.ReplaceExtension(p.path, ext))
}
func (p ModuleSrcPath) resPathWithName(ctx ModuleContext, name string) ModuleResPath {