Separate InstallPath from OutputPath
Create a new type InstallPath that is similar to OutputPath to differentiate intermediates output paths from installed output paths. RelPathString is a poorly defined, undocumented function that is primarily used to get an install path relative to out/soong to generate an equivalent install path for Make relative to $(OUT_DIR). Move it to InstallPath for now, and fix the one remaining user on OutputPath. Add a method to create an NDK install path so that ndk_sysroot.go doesn't have to do it manually with PathForOutput. Bug: 141877526 Test: m checkbuild Change-Id: I83c5a0bd1fd6c3dba8d3b6d20d039f64f353ddd5
This commit is contained in:
@@ -147,10 +147,10 @@ type ModuleContext interface {
|
||||
ExpandSource(srcFile, prop string) Path
|
||||
ExpandOptionalSource(srcFile *string, prop string) OptionalPath
|
||||
|
||||
InstallExecutable(installPath OutputPath, name string, srcPath Path, deps ...Path) OutputPath
|
||||
InstallFile(installPath OutputPath, name string, srcPath Path, deps ...Path) OutputPath
|
||||
InstallSymlink(installPath OutputPath, name string, srcPath OutputPath) OutputPath
|
||||
InstallAbsoluteSymlink(installPath OutputPath, name string, absPath string) OutputPath
|
||||
InstallExecutable(installPath InstallPath, name string, srcPath Path, deps ...Path) InstallPath
|
||||
InstallFile(installPath InstallPath, name string, srcPath Path, deps ...Path) InstallPath
|
||||
InstallSymlink(installPath InstallPath, name string, srcPath InstallPath) InstallPath
|
||||
InstallAbsoluteSymlink(installPath InstallPath, name string, absPath string) InstallPath
|
||||
CheckbuildFile(srcPath Path)
|
||||
|
||||
InstallInData() bool
|
||||
@@ -1536,7 +1536,7 @@ func (m *moduleContext) InstallBypassMake() bool {
|
||||
return m.module.InstallBypassMake()
|
||||
}
|
||||
|
||||
func (m *moduleContext) skipInstall(fullInstallPath OutputPath) bool {
|
||||
func (m *moduleContext) skipInstall(fullInstallPath InstallPath) bool {
|
||||
if m.module.base().commonProperties.SkipInstall {
|
||||
return true
|
||||
}
|
||||
@@ -1561,18 +1561,18 @@ func (m *moduleContext) skipInstall(fullInstallPath OutputPath) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (m *moduleContext) InstallFile(installPath OutputPath, name string, srcPath Path,
|
||||
deps ...Path) OutputPath {
|
||||
func (m *moduleContext) InstallFile(installPath InstallPath, name string, srcPath Path,
|
||||
deps ...Path) InstallPath {
|
||||
return m.installFile(installPath, name, srcPath, Cp, deps)
|
||||
}
|
||||
|
||||
func (m *moduleContext) InstallExecutable(installPath OutputPath, name string, srcPath Path,
|
||||
deps ...Path) OutputPath {
|
||||
func (m *moduleContext) InstallExecutable(installPath InstallPath, name string, srcPath Path,
|
||||
deps ...Path) InstallPath {
|
||||
return m.installFile(installPath, name, srcPath, CpExecutable, deps)
|
||||
}
|
||||
|
||||
func (m *moduleContext) installFile(installPath OutputPath, name string, srcPath Path,
|
||||
rule blueprint.Rule, deps []Path) OutputPath {
|
||||
func (m *moduleContext) installFile(installPath InstallPath, name string, srcPath Path,
|
||||
rule blueprint.Rule, deps []Path) InstallPath {
|
||||
|
||||
fullInstallPath := installPath.Join(m, name)
|
||||
m.module.base().hooks.runInstallHooks(m, fullInstallPath, false)
|
||||
@@ -1607,7 +1607,7 @@ func (m *moduleContext) installFile(installPath OutputPath, name string, srcPath
|
||||
return fullInstallPath
|
||||
}
|
||||
|
||||
func (m *moduleContext) InstallSymlink(installPath OutputPath, name string, srcPath OutputPath) OutputPath {
|
||||
func (m *moduleContext) InstallSymlink(installPath InstallPath, name string, srcPath InstallPath) InstallPath {
|
||||
fullInstallPath := installPath.Join(m, name)
|
||||
m.module.base().hooks.runInstallHooks(m, fullInstallPath, true)
|
||||
|
||||
@@ -1636,7 +1636,7 @@ func (m *moduleContext) InstallSymlink(installPath OutputPath, name string, srcP
|
||||
|
||||
// installPath/name -> absPath where absPath might be a path that is available only at runtime
|
||||
// (e.g. /apex/...)
|
||||
func (m *moduleContext) InstallAbsoluteSymlink(installPath OutputPath, name string, absPath string) OutputPath {
|
||||
func (m *moduleContext) InstallAbsoluteSymlink(installPath InstallPath, name string, absPath string) InstallPath {
|
||||
fullInstallPath := installPath.Join(m, name)
|
||||
m.module.base().hooks.runInstallHooks(m, fullInstallPath, true)
|
||||
|
||||
|
Reference in New Issue
Block a user