diff options
author | Colin Cross <ccross@android.com> | 2017-08-31 12:29:17 -0700 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2017-08-31 13:48:52 -0700 |
commit | 5c51792926b063945d786cc8a1e407a2ce2159cf (patch) | |
tree | cef55100e4632b4a1c4d141392287802c65f3693 /android/module.go | |
parent | add7fdf1a5d7652cfc8ef8da4e517eb4e11e0e08 (diff) | |
download | build_soong-5c51792926b063945d786cc8a1e407a2ce2159cf.tar.gz build_soong-5c51792926b063945d786cc8a1e407a2ce2159cf.tar.bz2 build_soong-5c51792926b063945d786cc8a1e407a2ce2159cf.zip |
Make binaries executable
Split InstallFileName into InstallExecutable that does chmod +x
after copying the file. Also remove InstallFile and rename
InstallFileName to InstallFile.
Test: m -j checkbuild
Change-Id: Id41ad4eafe521f6cd5d8cc250b7747ecb3da8dfc
Diffstat (limited to 'android/module.go')
-rw-r--r-- | android/module.go | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/android/module.go b/android/module.go index 3a3d1735..fb2e7030 100644 --- a/android/module.go +++ b/android/module.go @@ -83,8 +83,8 @@ type ModuleContext interface { ExpandSourcesSubDir(srcFiles, excludes []string, subDir string) Paths Glob(globPattern string, excludes []string) Paths - InstallFile(installPath OutputPath, srcPath Path, deps ...Path) OutputPath - InstallFileName(installPath OutputPath, name string, srcPath Path, deps ...Path) OutputPath + 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 CheckbuildFile(srcPath Path) @@ -717,8 +717,18 @@ func (a *androidModuleContext) skipInstall(fullInstallPath OutputPath) bool { return false } -func (a *androidModuleContext) InstallFileName(installPath OutputPath, name string, srcPath Path, +func (a *androidModuleContext) InstallFile(installPath OutputPath, name string, srcPath Path, deps ...Path) OutputPath { + return a.installFile(installPath, name, srcPath, Cp, deps) +} + +func (a *androidModuleContext) InstallExecutable(installPath OutputPath, name string, srcPath Path, + deps ...Path) OutputPath { + return a.installFile(installPath, name, srcPath, CpExecutable, deps) +} + +func (a *androidModuleContext) installFile(installPath OutputPath, name string, srcPath Path, + rule blueprint.Rule, deps []Path) OutputPath { fullInstallPath := installPath.Join(a, name) a.module.base().hooks.runInstallHooks(a, fullInstallPath, false) @@ -738,7 +748,7 @@ func (a *androidModuleContext) InstallFileName(installPath OutputPath, name stri } a.ModuleBuild(pctx, ModuleBuildParams{ - Rule: Cp, + Rule: rule, Description: "install " + fullInstallPath.Base(), Output: fullInstallPath, Input: srcPath, @@ -753,10 +763,6 @@ func (a *androidModuleContext) InstallFileName(installPath OutputPath, name stri return fullInstallPath } -func (a *androidModuleContext) InstallFile(installPath OutputPath, srcPath Path, deps ...Path) OutputPath { - return a.InstallFileName(installPath, filepath.Base(srcPath.String()), srcPath, deps...) -} - func (a *androidModuleContext) InstallSymlink(installPath OutputPath, name string, srcPath OutputPath) OutputPath { fullInstallPath := installPath.Join(a, name) a.module.base().hooks.runInstallHooks(a, fullInstallPath, true) |