diff options
| author | ruki <[email protected]> | 2020-09-30 22:57:09 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-09-30 22:57:09 +0800 |
| commit | 91ecb5c9596db8f176932244a49d940d594380cf (patch) | |
| tree | 97451f6498b00bb8616deea7015de864ca5caec9 | |
| parent | 5313aebdb80760af9932e7bdcd606b7be56d5a82 (diff) | |
rename package/action to actions
| -rw-r--r-- | xmake/actions/require/impl/actions/download.lua (renamed from xmake/actions/require/impl/action/download.lua) | 0 | ||||
| -rw-r--r-- | xmake/actions/require/impl/actions/download_resources.lua (renamed from xmake/actions/require/impl/action/download_resources.lua) | 0 | ||||
| -rw-r--r-- | xmake/actions/require/impl/actions/install.lua (renamed from xmake/actions/require/impl/action/install.lua) | 0 | ||||
| -rw-r--r-- | xmake/actions/require/impl/actions/patch_sources.lua (renamed from xmake/actions/require/impl/action/patch_sources.lua) | 0 | ||||
| -rw-r--r-- | xmake/actions/require/impl/actions/test.lua (renamed from xmake/actions/require/impl/action/test.lua) | 0 | ||||
| -rw-r--r-- | xmake/actions/require/impl/package.lua | 7 | ||||
| -rw-r--r-- | xmake/modules/action/install/main.lua | 4 | ||||
| -rw-r--r-- | xmake/modules/action/install/unix.lua | 18 | ||||
| -rw-r--r-- | xmake/modules/action/install/windows.lua | 22 | ||||
| -rw-r--r-- | xmake/modules/action/uninstall/main.lua | 4 | ||||
| -rw-r--r-- | xmake/modules/action/uninstall/unix.lua | 18 | ||||
| -rw-r--r-- | xmake/modules/action/uninstall/windows.lua | 22 |
12 files changed, 48 insertions, 47 deletions
diff --git a/xmake/actions/require/impl/action/download.lua b/xmake/actions/require/impl/actions/download.lua index 57f28989f..57f28989f 100644 --- a/xmake/actions/require/impl/action/download.lua +++ b/xmake/actions/require/impl/actions/download.lua diff --git a/xmake/actions/require/impl/action/download_resources.lua b/xmake/actions/require/impl/actions/download_resources.lua index 310a6732a..310a6732a 100644 --- a/xmake/actions/require/impl/action/download_resources.lua +++ b/xmake/actions/require/impl/actions/download_resources.lua diff --git a/xmake/actions/require/impl/action/install.lua b/xmake/actions/require/impl/actions/install.lua index 01079bb8b..01079bb8b 100644 --- a/xmake/actions/require/impl/action/install.lua +++ b/xmake/actions/require/impl/actions/install.lua diff --git a/xmake/actions/require/impl/action/patch_sources.lua b/xmake/actions/require/impl/actions/patch_sources.lua index e7e5aa467..e7e5aa467 100644 --- a/xmake/actions/require/impl/action/patch_sources.lua +++ b/xmake/actions/require/impl/actions/patch_sources.lua diff --git a/xmake/actions/require/impl/action/test.lua b/xmake/actions/require/impl/actions/test.lua index 0e1fe32b5..0e1fe32b5 100644 --- a/xmake/actions/require/impl/action/test.lua +++ b/xmake/actions/require/impl/actions/test.lua diff --git a/xmake/actions/require/impl/package.lua b/xmake/actions/require/impl/package.lua index eb36b1467..b1177fb8a 100644 --- a/xmake/actions/require/impl/package.lua +++ b/xmake/actions/require/impl/package.lua @@ -30,7 +30,8 @@ import("private.utils.progress") import("lib.detect.cache", {alias = "detectcache"}) import("core.project.project") import("core.package.package", {alias = "core_package"}) -import("action") +import("actions.install", {alias = "action_install"}) +import("actions.download", {alias = "action_download"}) import("devel.git") import("net.fasturl") import("repository") @@ -628,14 +629,14 @@ function _install_packages(packages_install, packages_download) local downloaded = true if packages_download[tostring(package)] then packages_downloading[index] = package - downloaded = action.download(package) + downloaded = action_download(package) packages_downloading[index] = nil end -- install this package packages_installing[index] = package if downloaded then - action.install(package) + action_install(package) end packages_installing[index] = nil diff --git a/xmake/modules/action/install/main.lua b/xmake/modules/action/install/main.lua index 51ced360f..f518abdd6 100644 --- a/xmake/modules/action/install/main.lua +++ b/xmake/modules/action/install/main.lua @@ -35,7 +35,7 @@ function _install_files(target) end -- the builtin install main entry -function main(target) +function main(target, opt) -- get install directory local installdir = target:installdir() @@ -51,7 +51,7 @@ function main(target) local install_style = target:is_plat("windows", "mingw") and "windows" or "unix" local script = import(install_style, {anonymous = true})["install_" .. target:targetkind()] if script then - script(target) + script(target, opt) end end diff --git a/xmake/modules/action/install/unix.lua b/xmake/modules/action/install/unix.lua index 634dd2e3a..e52b091b1 100644 --- a/xmake/modules/action/install/unix.lua +++ b/xmake/modules/action/install/unix.lua @@ -19,15 +19,15 @@ -- -- install library -function _install_library(target) +function _install_library(target, opt) -- install libraries - local librarydir = path.join(target:installdir(), "lib") + local librarydir = path.join(target:installdir(), opt and opt.libdir or "lib") os.mkdir(librarydir) os.vcp(target:targetfile(), librarydir) -- install headers - local includedir = path.join(target:installdir(), "include") + local includedir = path.join(target:installdir(), opt and opt.includedir or "include") os.mkdir(includedir) local srcheaders, dstheaders = target:headerfiles(includedir) if srcheaders and dstheaders then @@ -43,18 +43,18 @@ function _install_library(target) end -- install binary -function install_binary(target) - local binarydir = path.join(target:installdir(), "bin") +function install_binary(target, opt) + local binarydir = path.join(target:installdir(), opt and opt.bindir or "bin") os.mkdir(binarydir) os.vcp(target:targetfile(), binarydir) end -- install shared library -function install_shared(target) - _install_library(target) +function install_shared(target, opt) + _install_library(target, opt) end -- install static library -function install_static(target) - _install_library(target) +function install_static(target, opt) + _install_library(target, opt) end diff --git a/xmake/modules/action/install/windows.lua b/xmake/modules/action/install/windows.lua index 3019152d1..7e9f6ab0b 100644 --- a/xmake/modules/action/install/windows.lua +++ b/xmake/modules/action/install/windows.lua @@ -22,8 +22,8 @@ import("lib.detect.find_file") -- install headers -function _install_headers(target) - local includedir = path.join(target:installdir(), "include") +function _install_headers(target, opt) + local includedir = path.join(target:installdir(), opt and opt.includedir or "include") os.mkdir(includedir) local srcheaders, dstheaders = target:headerfiles(includedir) if srcheaders and dstheaders then @@ -66,10 +66,10 @@ function _install_shared_for_packages(target, outputdir) end -- install binary -function install_binary(target) +function install_binary(target, opt) -- install binary - local binarydir = path.join(target:installdir(), "bin") + local binarydir = path.join(target:installdir(), opt and opt.bindir or "bin") os.mkdir(binarydir) os.vcp(target:targetfile(), binarydir) @@ -89,17 +89,17 @@ function install_binary(target) end -- install shared library -function install_shared(target) +function install_shared(target, opt) -- install dll library to the binary directory - local binarydir = path.join(target:installdir(), "bin") + local binarydir = path.join(target:installdir(), opt and opt.bindir or "bin") os.mkdir(binarydir) os.vcp(target:targetfile(), binarydir) -- install *.lib for shared/windows (*.dll) target -- @see https://github.com/xmake-io/xmake/issues/714 local targetfile = target:targetfile() - local librarydir = path.join(target:installdir(), "lib") + local librarydir = path.join(target:installdir(), opt and opt.libdir or "lib") local targetfile_lib = path.join(path.directory(targetfile), path.basename(targetfile) .. ".lib") if os.isfile(targetfile_lib) then os.mkdir(librarydir) @@ -110,17 +110,17 @@ function install_shared(target) _install_shared_for_packages(target, binarydir) -- install headers - _install_headers(target) + _install_headers(target, opt) end -- install static library -function install_static(target) +function install_static(target, opt) -- install library - local librarydir = path.join(target:installdir(), "lib") + local librarydir = path.join(target:installdir(), opt and opt.libdir or "lib") os.mkdir(librarydir) os.vcp(target:targetfile(), librarydir) -- install headers - _install_headers(target) + _install_headers(target, opt) end diff --git a/xmake/modules/action/uninstall/main.lua b/xmake/modules/action/uninstall/main.lua index fe9b7e2db..440752725 100644 --- a/xmake/modules/action/uninstall/main.lua +++ b/xmake/modules/action/uninstall/main.lua @@ -27,7 +27,7 @@ function _uninstall_files(target) end -- the builtin uninstall main entry -function main(target) +function main(target, opt) -- get install directory local installdir = target:installdir() @@ -43,7 +43,7 @@ function main(target) local install_style = target:is_plat("windows", "mingw") and "windows" or "unix" local script = import(install_style, {anonymous = true})["uninstall_" .. target:targetkind()] if script then - script(target) + script(target, opt) end end diff --git a/xmake/modules/action/uninstall/unix.lua b/xmake/modules/action/uninstall/unix.lua index 90f07d364..f7423da0a 100644 --- a/xmake/modules/action/uninstall/unix.lua +++ b/xmake/modules/action/uninstall/unix.lua @@ -19,14 +19,14 @@ -- -- uninstall library -function _uninstall_library(target) +function _uninstall_library(target, opt) -- remove the target file - local librarydir = path.join(target:installdir(), "lib") + local librarydir = path.join(target:installdir(), opt and opt.libdir or "lib") os.vrm(path.join(librarydir, path.filename(target:targetfile()))) -- remove headers from the include directory - local includedir = path.join(target:installdir(), "include") + local includedir = path.join(target:installdir(), opt and opt.includedir or "include") local _, dstheaders = target:headerfiles(includedir) for _, dstheader in ipairs(dstheaders) do os.vrm(dstheader) @@ -34,17 +34,17 @@ function _uninstall_library(target) end -- uninstall binary -function uninstall_binary(target) - local binarydir = path.join(target:installdir(), "bin") +function uninstall_binary(target, opt) + local binarydir = path.join(target:installdir(), opt and opt.bindir or "bin") os.vrm(path.join(binarydir, path.filename(target:targetfile()))) end -- uninstall shared library -function uninstall_shared(target) - _uninstall_library(target) +function uninstall_shared(target, opt) + _uninstall_library(target, opt) end -- uninstall static library -function uninstall_static(target) - _uninstall_library(target) +function uninstall_static(target, opt) + _uninstall_library(target, opt) end diff --git a/xmake/modules/action/uninstall/windows.lua b/xmake/modules/action/uninstall/windows.lua index 865e80c7e..d4ddf88a2 100644 --- a/xmake/modules/action/uninstall/windows.lua +++ b/xmake/modules/action/uninstall/windows.lua @@ -19,8 +19,8 @@ -- -- uninstall headers -function _uninstall_headers(target) - local includedir = path.join(target:installdir(), "include") +function _uninstall_headers(target, opt) + local includedir = path.join(target:installdir(), opt and opt.includedir or "include") local _, dstheaders = target:headerfiles(includedir) for _, dstheader in ipairs(dstheaders) do os.vrm(dstheader) @@ -52,10 +52,10 @@ function _uninstall_shared_for_packages(target, outputdir) end -- uninstall binary -function uninstall_binary(target) +function uninstall_binary(target, opt) -- remove the target file - local binarydir = path.join(target:installdir(), "bin") + local binarydir = path.join(target:installdir(), opt and opt.bindir or "bin") os.vrm(path.join(binarydir, path.filename(target:targetfile()))) -- remove the dependent shared/windows (*.dll) target @@ -71,32 +71,32 @@ function uninstall_binary(target) end -- uninstall shared library -function uninstall_shared(target) +function uninstall_shared(target, opt) -- remove the target file - local binarydir = path.join(target:installdir(), "bin") + local binarydir = path.join(target:installdir(), opt and opt.bindir or "bin") os.vrm(path.join(binarydir, path.filename(target:targetfile()))) -- remove *.lib for shared/windows (*.dll) target -- @see https://github.com/xmake-io/xmake/issues/714 local targetfile = target:targetfile() - local librarydir = path.join(target:installdir(), "lib") + local librarydir = path.join(target:installdir(), opt and opt.libdir or "lib") os.vrm(path.join(librarydir, path.basename(targetfile) .. ".lib")) -- remove headers from the include directory - _uninstall_headers(target) + _uninstall_headers(target, opt) -- uninstall shared libraries for packages _uninstall_shared_for_packages(target, binarydir) end -- uninstall static library -function uninstall_static(target) +function uninstall_static(target, opt) -- remove the target file - local librarydir = path.join(target:installdir(), "lib") + local librarydir = path.join(target:installdir(), opt and opt.libdir or "lib") os.vrm(path.join(librarydir, path.filename(target:targetfile()))) -- remove headers from the include directory - _uninstall_headers(target) + _uninstall_headers(target, opt) end |
