diff options
Diffstat (limited to 'android/module_context.go')
-rw-r--r-- | android/module_context.go | 55 |
1 files changed, 40 insertions, 15 deletions
diff --git a/android/module_context.go b/android/module_context.go index c677f9482..6c52a7e39 100644 --- a/android/module_context.go +++ b/android/module_context.go @@ -122,6 +122,16 @@ type ModuleContext interface { // dependency tags for which IsInstallDepNeeded returns true. InstallFile(installPath InstallPath, name string, srcPath Path, deps ...InstallPath) InstallPath + // InstallFileWithoutCheckbuild creates a rule to copy srcPath to name in the installPath directory, + // with the given additional dependencies, but does not add the file to the list of files to build + // during `m checkbuild`. + // + // The installed file will be returned by FilesToInstall(), and the PackagingSpec for the + // installed file will be returned by PackagingSpecs() on this module or by + // TransitivePackagingSpecs() on modules that depend on this module through dependency tags + // for which IsInstallDepNeeded returns true. + InstallFileWithoutCheckbuild(installPath InstallPath, name string, srcPath Path, deps ...InstallPath) InstallPath + // InstallFileWithExtraFilesZip creates a rule to copy srcPath to name in the installPath // directory, and also unzip a zip file containing extra files to install into the same // directory. @@ -168,7 +178,8 @@ type ModuleContext interface { // dependency tags for which IsInstallDepNeeded returns true. PackageFile(installPath InstallPath, name string, srcPath Path) PackagingSpec - CheckbuildFile(srcPath Path) + CheckbuildFile(srcPaths ...Path) + UncheckedModule() InstallInData() bool InstallInTestcases() bool @@ -237,11 +248,13 @@ type ModuleContext interface { type moduleContext struct { bp blueprint.ModuleContext baseModuleContext - packagingSpecs []PackagingSpec - installFiles InstallPaths - checkbuildFiles Paths - module Module - phonies map[string]Paths + packagingSpecs []PackagingSpec + installFiles InstallPaths + checkbuildFiles Paths + checkbuildTarget Path + uncheckedModule bool + module Module + phonies map[string]Paths // outputFiles stores the output of a module by tag and is used to set // the OutputFilesProvider in GenerateBuildActions outputFiles OutputFilesInfo @@ -512,17 +525,22 @@ func (m *moduleContext) requiresFullInstall() bool { func (m *moduleContext) InstallFile(installPath InstallPath, name string, srcPath Path, deps ...InstallPath) InstallPath { - return m.installFile(installPath, name, srcPath, deps, false, true, nil) + return m.installFile(installPath, name, srcPath, deps, false, true, true, nil) +} + +func (m *moduleContext) InstallFileWithoutCheckbuild(installPath InstallPath, name string, srcPath Path, + deps ...InstallPath) InstallPath { + return m.installFile(installPath, name, srcPath, deps, false, true, false, nil) } func (m *moduleContext) InstallExecutable(installPath InstallPath, name string, srcPath Path, deps ...InstallPath) InstallPath { - return m.installFile(installPath, name, srcPath, deps, true, true, nil) + return m.installFile(installPath, name, srcPath, deps, true, true, true, nil) } func (m *moduleContext) InstallFileWithExtraFilesZip(installPath InstallPath, name string, srcPath Path, extraZip Path, deps ...InstallPath) InstallPath { - return m.installFile(installPath, name, srcPath, deps, false, true, &extraFilesZip{ + return m.installFile(installPath, name, srcPath, deps, false, true, true, &extraFilesZip{ zip: extraZip, dir: installPath, }) @@ -559,7 +577,7 @@ func (m *moduleContext) packageFile(fullInstallPath InstallPath, srcPath Path, e } func (m *moduleContext) installFile(installPath InstallPath, name string, srcPath Path, deps []InstallPath, - executable bool, hooks bool, extraZip *extraFilesZip) InstallPath { + executable bool, hooks bool, checkbuild bool, extraZip *extraFilesZip) InstallPath { fullInstallPath := installPath.Join(m, name) if hooks { @@ -626,7 +644,9 @@ func (m *moduleContext) installFile(installPath InstallPath, name string, srcPat m.packageFile(fullInstallPath, srcPath, executable) - m.checkbuildFiles = append(m.checkbuildFiles, srcPath) + if checkbuild { + m.checkbuildFiles = append(m.checkbuildFiles, srcPath) + } return fullInstallPath } @@ -667,7 +687,6 @@ func (m *moduleContext) InstallSymlink(installPath InstallPath, name string, src } m.installFiles = append(m.installFiles, fullInstallPath) - m.checkbuildFiles = append(m.checkbuildFiles, srcPath) } m.packagingSpecs = append(m.packagingSpecs, PackagingSpec{ @@ -734,15 +753,21 @@ func (m *moduleContext) InstallTestData(installPath InstallPath, data []DataPath ret := make(InstallPaths, 0, len(data)) for _, d := range data { relPath := d.ToRelativeInstallPath() - installed := m.installFile(installPath, relPath, d.SrcPath, nil, false, false, nil) + installed := m.installFile(installPath, relPath, d.SrcPath, nil, false, false, true, nil) ret = append(ret, installed) } return ret } -func (m *moduleContext) CheckbuildFile(srcPath Path) { - m.checkbuildFiles = append(m.checkbuildFiles, srcPath) +// CheckbuildFile specifies the output files that should be built by checkbuild. +func (m *moduleContext) CheckbuildFile(srcPaths ...Path) { + m.checkbuildFiles = append(m.checkbuildFiles, srcPaths...) +} + +// UncheckedModule marks the current module has having no files that should be built by checkbuild. +func (m *moduleContext) UncheckedModule() { + m.uncheckedModule = true } func (m *moduleContext) blueprintModuleContext() blueprint.ModuleContext { |