summaryrefslogtreecommitdiff
path: root/android/hooks.go
diff options
context:
space:
mode:
author David Srbecky <dsrbecky@google.com> 2020-06-04 01:26:16 +0100
committer David Srbecky <dsrbecky@google.com> 2020-06-04 01:26:16 +0100
commit07656410df1836a70bea3054e50bb410ecbf8e07 (patch)
tree96dc0b045dfa8b0d3a07d6e41acb1c961cd811df /android/hooks.go
parent3747336d233103c9660d06699f6ac1bb86d405ce (diff)
Add SrcPath to InstallHookContext
Needed by ART to find the intermediate files so that it can also install them in testcases directory for tests. Change-Id: If1b2ad132632c5dc7c6c7573b56680e2f422594a
Diffstat (limited to 'android/hooks.go')
-rw-r--r--android/hooks.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/android/hooks.go b/android/hooks.go
index f43a007a0..85fc08168 100644
--- a/android/hooks.go
+++ b/android/hooks.go
@@ -120,6 +120,7 @@ func (l *loadHookContext) registerScopedModuleType(name string, factory blueprin
type InstallHookContext interface {
ModuleContext
+ SrcPath() Path
Path() InstallPath
Symlink() bool
}
@@ -134,10 +135,17 @@ func AddInstallHook(m blueprint.Module, hook func(InstallHookContext)) {
type installHookContext struct {
ModuleContext
+ srcPath Path
path InstallPath
symlink bool
}
+var _ InstallHookContext = &installHookContext{}
+
+func (x *installHookContext) SrcPath() Path {
+ return x.srcPath
+}
+
func (x *installHookContext) Path() InstallPath {
return x.path
}
@@ -146,10 +154,11 @@ func (x *installHookContext) Symlink() bool {
return x.symlink
}
-func (x *hooks) runInstallHooks(ctx ModuleContext, path InstallPath, symlink bool) {
+func (x *hooks) runInstallHooks(ctx ModuleContext, srcPath Path, path InstallPath, symlink bool) {
if len(x.install) > 0 {
mctx := &installHookContext{
ModuleContext: ctx,
+ srcPath: srcPath,
path: path,
symlink: symlink,
}