summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2021-03-25 22:46:45 +0800
committerruki <[email protected]>2021-03-25 22:46:45 +0800
commitdf6916d52a29ce6b66ad913016c90f8c0e4cbebb (patch)
treea33d130ecf8ff634544261d80c7d417839653aa1
parenta08f25c000bf50f0530a2fc56406a414d4da04b1 (diff)
remove unused package api
-rw-r--r--xmake/core/package/package.lua8
-rw-r--r--xmake/modules/private/action/require/impl/actions/install.lua17
-rw-r--r--xmake/modules/private/action/require/impl/actions/test.lua16
3 files changed, 6 insertions, 35 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua
index 033503580..7438896b7 100644
--- a/xmake/core/package/package.lua
+++ b/xmake/core/package/package.lua
@@ -1611,14 +1611,6 @@ function package.apis()
, "package.on_fetch"
, "package.on_install"
, "package.on_test"
-
- -- package.before_xxx
- , "package.before_install"
- , "package.before_test"
-
- -- package.before_xxx
- , "package.after_install"
- , "package.after_test"
}
, keyvalues =
{
diff --git a/xmake/modules/private/action/require/impl/actions/install.lua b/xmake/modules/private/action/require/impl/actions/install.lua
index 91cee4ba3..57511a930 100644
--- a/xmake/modules/private/action/require/impl/actions/install.lua
+++ b/xmake/modules/private/action/require/impl/actions/install.lua
@@ -136,18 +136,10 @@ function main(package)
{
function ()
- -- the package scripts
- local scripts =
- {
- package:script("install_before")
- , package:script("install")
- , package:script("install_after")
- }
-
-- install the third-party package directly, e.g. brew::pcre2/libpcre2-8, conan::OpenSSL/1.0.2n@conan/stable
local installed_now = false
+ local script = package:script("install")
if package:is_thirdparty() then
- local script = package:script("install")
if script ~= nil then
filter.call(script, package)
end
@@ -174,11 +166,8 @@ function main(package)
_check_package_toolchains(package)
-- do install
- for i = 1, 3 do
- local script = scripts[i]
- if script ~= nil then
- filter.call(script, package)
- end
+ if script ~= nil then
+ filter.call(script, package)
end
-- leave the environments of all package dependencies
diff --git a/xmake/modules/private/action/require/impl/actions/test.lua b/xmake/modules/private/action/require/impl/actions/test.lua
index f29910f2a..b156caef9 100644
--- a/xmake/modules/private/action/require/impl/actions/test.lua
+++ b/xmake/modules/private/action/require/impl/actions/test.lua
@@ -25,14 +25,6 @@ import("private.action.require.impl.utils.filter")
-- test the given package
function main(package)
- -- the package scripts
- local scripts =
- {
- package:script("test_before")
- , package:script("test")
- , package:script("test_after")
- }
-
-- enter the test directory
local testdir = path.join(os.tmpdir(), "pkgtest", package:name(), package:version_str() or "latest")
if os.isdir(testdir) then
@@ -44,11 +36,9 @@ function main(package)
local oldir = os.cd(testdir)
-- test it
- for i = 1, 3 do
- local script = scripts[i]
- if script ~= nil then
- filter.call(script, package)
- end
+ local script = package:script("test")
+ if script ~= nil then
+ filter.call(script, package)
end
-- restore the current directory