diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2019-03-15 09:02:18 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2019-03-15 09:02:18 +0000 |
commit | 7487fb54feb9a21e0ba774734556a38aedf4aef5 (patch) | |
tree | 7aebe58851da5d8cc5782f862e7450274707ec30 /android | |
parent | 6f933e5528c207994249b8cb66281fff41a60429 (diff) | |
parent | f11943527d5fee8c253a23c959ebb70267721652 (diff) | |
download | build_soong-7487fb54feb9a21e0ba774734556a38aedf4aef5.tar.gz build_soong-7487fb54feb9a21e0ba774734556a38aedf4aef5.tar.bz2 build_soong-7487fb54feb9a21e0ba774734556a38aedf4aef5.zip |
Merge "Create symlink for bionic files"
Diffstat (limited to 'android')
-rw-r--r-- | android/module.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/android/module.go b/android/module.go index c1f3e793..c5252c8b 100644 --- a/android/module.go +++ b/android/module.go @@ -124,6 +124,7 @@ type ModuleContext interface { 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 CheckbuildFile(srcPath Path) AddMissingDependencies(deps []string) @@ -1316,6 +1317,28 @@ func (a *androidModuleContext) InstallSymlink(installPath OutputPath, name strin return fullInstallPath } +// installPath/name -> absPath where absPath might be a path that is available only at runtime +// (e.g. /apex/...) +func (a *androidModuleContext) InstallAbsoluteSymlink(installPath OutputPath, name string, absPath string) OutputPath { + fullInstallPath := installPath.Join(a, name) + a.module.base().hooks.runInstallHooks(a, fullInstallPath, true) + + if !a.skipInstall(fullInstallPath) { + a.Build(pctx, BuildParams{ + Rule: Symlink, + Description: "install symlink " + fullInstallPath.Base() + " -> " + absPath, + Output: fullInstallPath, + Default: !a.Config().EmbeddedInMake(), + Args: map[string]string{ + "fromPath": absPath, + }, + }) + + a.installFiles = append(a.installFiles, fullInstallPath) + } + return fullInstallPath +} + func (a *androidModuleContext) CheckbuildFile(srcPath Path) { a.checkbuildFiles = append(a.checkbuildFiles, srcPath) } |