Merge changes I0f746a11,I08e61a24
* changes:
Make OutputPath implement objPathProvider
Allow CopyDepsToZip() to work on WritablePath
diff --git a/android/packaging.go b/android/packaging.go
index df2533f..9b901ce 100644
--- a/android/packaging.go
+++ b/android/packaging.go
@@ -66,7 +66,7 @@
// returns zip entries in it. This is expected to be called in GenerateAndroidBuildActions,
// followed by a build rule that unzips it and creates the final output (img, zip, tar.gz,
// etc.) from the extracted files
- CopyDepsToZip(ctx ModuleContext, zipOut OutputPath) []string
+ CopyDepsToZip(ctx ModuleContext, zipOut WritablePath) []string
}
// PackagingBase provides basic functionality for packaging dependencies. A module is expected to
@@ -180,7 +180,7 @@
}
// See PackageModule.CopyDepsToZip
-func (p *PackagingBase) CopyDepsToZip(ctx ModuleContext, zipOut OutputPath) (entries []string) {
+func (p *PackagingBase) CopyDepsToZip(ctx ModuleContext, zipOut WritablePath) (entries []string) {
m := make(map[string]PackagingSpec)
ctx.WalkDeps(func(child Module, parent Module) bool {
if !IsInstallDepNeeded(ctx.OtherModuleDependencyTag(child)) {
@@ -196,7 +196,7 @@
builder := NewRuleBuilder(pctx, ctx)
- dir := PathForModuleOut(ctx, ".zip").OutputPath
+ dir := PathForModuleOut(ctx, ".zip")
builder.Command().Text("rm").Flag("-rf").Text(dir.String())
builder.Command().Text("mkdir").Flag("-p").Text(dir.String())
diff --git a/android/packaging_test.go b/android/packaging_test.go
index dc259dd..2c99b97 100644
--- a/android/packaging_test.go
+++ b/android/packaging_test.go
@@ -80,7 +80,7 @@
}
func (m *packageTestModule) GenerateAndroidBuildActions(ctx ModuleContext) {
- zipFile := PathForModuleOut(ctx, "myzip.zip").OutputPath
+ zipFile := PathForModuleOut(ctx, "myzip.zip")
m.entries = m.CopyDepsToZip(ctx, zipFile)
}
diff --git a/android/paths.go b/android/paths.go
index b5a1401..8106958 100644
--- a/android/paths.go
+++ b/android/paths.go
@@ -1011,8 +1011,13 @@
return p.config.buildDir
}
+func (p OutputPath) objPathWithExt(ctx ModuleOutPathContext, subdir, ext string) ModuleObjPath {
+ return PathForModuleObj(ctx, subdir, pathtools.ReplaceExtension(p.path, ext))
+}
+
var _ Path = OutputPath{}
var _ WritablePath = OutputPath{}
+var _ objPathProvider = OutputPath{}
// toolDepPath is a Path representing a dependency of the build tool.
type toolDepPath struct {