Loading android/hooks.go +10 −1 Original line number Original line Diff line number Diff line Loading @@ -120,6 +120,7 @@ func (l *loadHookContext) registerScopedModuleType(name string, factory blueprin type InstallHookContext interface { type InstallHookContext interface { ModuleContext ModuleContext SrcPath() Path Path() InstallPath Path() InstallPath Symlink() bool Symlink() bool } } Loading @@ -134,10 +135,17 @@ func AddInstallHook(m blueprint.Module, hook func(InstallHookContext)) { type installHookContext struct { type installHookContext struct { ModuleContext ModuleContext srcPath Path path InstallPath path InstallPath symlink bool symlink bool } } var _ InstallHookContext = &installHookContext{} func (x *installHookContext) SrcPath() Path { return x.srcPath } func (x *installHookContext) Path() InstallPath { func (x *installHookContext) Path() InstallPath { return x.path return x.path } } Loading @@ -146,10 +154,11 @@ func (x *installHookContext) Symlink() bool { return x.symlink 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 { if len(x.install) > 0 { mctx := &installHookContext{ mctx := &installHookContext{ ModuleContext: ctx, ModuleContext: ctx, srcPath: srcPath, path: path, path: path, symlink: symlink, symlink: symlink, } } Loading android/module.go +3 −3 Original line number Original line Diff line number Diff line Loading @@ -1959,7 +1959,7 @@ func (m *moduleContext) installFile(installPath InstallPath, name string, srcPat rule blueprint.Rule, deps []Path) InstallPath { rule blueprint.Rule, deps []Path) InstallPath { fullInstallPath := installPath.Join(m, name) fullInstallPath := installPath.Join(m, name) m.module.base().hooks.runInstallHooks(m, fullInstallPath, false) m.module.base().hooks.runInstallHooks(m, srcPath, fullInstallPath, false) if !m.skipInstall(fullInstallPath) { if !m.skipInstall(fullInstallPath) { Loading Loading @@ -1993,7 +1993,7 @@ func (m *moduleContext) installFile(installPath InstallPath, name string, srcPat func (m *moduleContext) InstallSymlink(installPath InstallPath, name string, srcPath InstallPath) InstallPath { func (m *moduleContext) InstallSymlink(installPath InstallPath, name string, srcPath InstallPath) InstallPath { fullInstallPath := installPath.Join(m, name) fullInstallPath := installPath.Join(m, name) m.module.base().hooks.runInstallHooks(m, fullInstallPath, true) m.module.base().hooks.runInstallHooks(m, srcPath, fullInstallPath, true) if !m.skipInstall(fullInstallPath) { if !m.skipInstall(fullInstallPath) { Loading Loading @@ -2022,7 +2022,7 @@ func (m *moduleContext) InstallSymlink(installPath InstallPath, name string, src // (e.g. /apex/...) // (e.g. /apex/...) func (m *moduleContext) InstallAbsoluteSymlink(installPath InstallPath, name string, absPath string) InstallPath { func (m *moduleContext) InstallAbsoluteSymlink(installPath InstallPath, name string, absPath string) InstallPath { fullInstallPath := installPath.Join(m, name) fullInstallPath := installPath.Join(m, name) m.module.base().hooks.runInstallHooks(m, fullInstallPath, true) m.module.base().hooks.runInstallHooks(m, nil, fullInstallPath, true) if !m.skipInstall(fullInstallPath) { if !m.skipInstall(fullInstallPath) { m.Build(pctx, BuildParams{ m.Build(pctx, BuildParams{ Loading Loading
android/hooks.go +10 −1 Original line number Original line Diff line number Diff line Loading @@ -120,6 +120,7 @@ func (l *loadHookContext) registerScopedModuleType(name string, factory blueprin type InstallHookContext interface { type InstallHookContext interface { ModuleContext ModuleContext SrcPath() Path Path() InstallPath Path() InstallPath Symlink() bool Symlink() bool } } Loading @@ -134,10 +135,17 @@ func AddInstallHook(m blueprint.Module, hook func(InstallHookContext)) { type installHookContext struct { type installHookContext struct { ModuleContext ModuleContext srcPath Path path InstallPath path InstallPath symlink bool symlink bool } } var _ InstallHookContext = &installHookContext{} func (x *installHookContext) SrcPath() Path { return x.srcPath } func (x *installHookContext) Path() InstallPath { func (x *installHookContext) Path() InstallPath { return x.path return x.path } } Loading @@ -146,10 +154,11 @@ func (x *installHookContext) Symlink() bool { return x.symlink 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 { if len(x.install) > 0 { mctx := &installHookContext{ mctx := &installHookContext{ ModuleContext: ctx, ModuleContext: ctx, srcPath: srcPath, path: path, path: path, symlink: symlink, symlink: symlink, } } Loading
android/module.go +3 −3 Original line number Original line Diff line number Diff line Loading @@ -1959,7 +1959,7 @@ func (m *moduleContext) installFile(installPath InstallPath, name string, srcPat rule blueprint.Rule, deps []Path) InstallPath { rule blueprint.Rule, deps []Path) InstallPath { fullInstallPath := installPath.Join(m, name) fullInstallPath := installPath.Join(m, name) m.module.base().hooks.runInstallHooks(m, fullInstallPath, false) m.module.base().hooks.runInstallHooks(m, srcPath, fullInstallPath, false) if !m.skipInstall(fullInstallPath) { if !m.skipInstall(fullInstallPath) { Loading Loading @@ -1993,7 +1993,7 @@ func (m *moduleContext) installFile(installPath InstallPath, name string, srcPat func (m *moduleContext) InstallSymlink(installPath InstallPath, name string, srcPath InstallPath) InstallPath { func (m *moduleContext) InstallSymlink(installPath InstallPath, name string, srcPath InstallPath) InstallPath { fullInstallPath := installPath.Join(m, name) fullInstallPath := installPath.Join(m, name) m.module.base().hooks.runInstallHooks(m, fullInstallPath, true) m.module.base().hooks.runInstallHooks(m, srcPath, fullInstallPath, true) if !m.skipInstall(fullInstallPath) { if !m.skipInstall(fullInstallPath) { Loading Loading @@ -2022,7 +2022,7 @@ func (m *moduleContext) InstallSymlink(installPath InstallPath, name string, src // (e.g. /apex/...) // (e.g. /apex/...) func (m *moduleContext) InstallAbsoluteSymlink(installPath InstallPath, name string, absPath string) InstallPath { func (m *moduleContext) InstallAbsoluteSymlink(installPath InstallPath, name string, absPath string) InstallPath { fullInstallPath := installPath.Join(m, name) fullInstallPath := installPath.Join(m, name) m.module.base().hooks.runInstallHooks(m, fullInstallPath, true) m.module.base().hooks.runInstallHooks(m, nil, fullInstallPath, true) if !m.skipInstall(fullInstallPath) { if !m.skipInstall(fullInstallPath) { m.Build(pctx, BuildParams{ m.Build(pctx, BuildParams{ Loading