Use `Path` instead of string for file paths
This centralizes verification and common operations, like converting the
path to a source file to the path for a built object.
It also embeds the configuration knowledge into the path, so that we can
remove "${SrcDir}/path" from the ninja file. When SrcDir is '.', that
leads to paths like './path' instead of just 'path' like make is doing,
causing differences in compiled binaries.
Change-Id: Ib4e8910a6e867ce1b7b420d927c04f1142a7589e
diff --git a/common/defs.go b/common/defs.go
index 7b2a706..9e185e4 100644
--- a/common/defs.go
+++ b/common/defs.go
@@ -20,13 +20,11 @@
)
var (
- pctx = blueprint.NewPackageContext("android/soong/common")
+ pctx = NewPackageContext("android/soong/common")
cpPreserveSymlinks = pctx.VariableConfigMethod("cpPreserveSymlinks",
Config.CpPreserveSymlinksFlags)
- srcDir = pctx.VariableConfigMethod("srcDir", Config.SrcDir)
-
// A phony rule that is not the built-in Ninja phony rule. The built-in
// phony rule has special behavior that is sometimes not desired. See the
// Ninja docs for more details.