summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2018-09-20 23:07:53 +0800
committerruki <[email protected]>2018-09-20 12:47:21 +0800
commit5a757da5cdb45c5027a0090188c5b6401146fff4 (patch)
tree2f933ad4182b5d2c644ec39bfe5f2eaf5acea29e
parentab631d5b0be6697d501aaa7e7cc3393dab343549 (diff)
disable target for clean, install actions
-rw-r--r--xmake/actions/clean/main.lua19
-rw-r--r--xmake/actions/install/install.lua19
-rw-r--r--xmake/actions/run/main.lua19
-rw-r--r--xmake/actions/uninstall/uninstall.lua19
4 files changed, 76 insertions, 0 deletions
diff --git a/xmake/actions/clean/main.lua b/xmake/actions/clean/main.lua
index f2b42806b..33451acdd 100644
--- a/xmake/actions/clean/main.lua
+++ b/xmake/actions/clean/main.lua
@@ -52,6 +52,11 @@ end
-- on clean target
function _on_clean_target(target)
+ -- has been disabled?
+ if target:get("enabled") == false then
+ return
+ end
+
-- build target with rules
local done = false
for _, r in ipairs(target:orderules()) do
@@ -107,6 +112,13 @@ function _clean_target(target)
{
target:script("clean_before")
, function (target)
+
+ -- has been disabled?
+ if target:get("enabled") == false then
+ return
+ end
+
+ -- clean rules
for _, r in ipairs(target:orderules()) do
local before_clean = r:script("clean_before")
if before_clean then
@@ -116,6 +128,13 @@ function _clean_target(target)
end
, target:script("clean", _on_clean_target)
, function (target)
+
+ -- has been disabled?
+ if target:get("enabled") == false then
+ return
+ end
+
+ -- clean rules
for _, r in ipairs(target:orderules()) do
local after_clean = r:script("clean_after")
if after_clean then
diff --git a/xmake/actions/install/install.lua b/xmake/actions/install/install.lua
index af4567bec..226b4076f 100644
--- a/xmake/actions/install/install.lua
+++ b/xmake/actions/install/install.lua
@@ -85,6 +85,11 @@ end
-- on install
function _on_install(target)
+ -- has been disabled?
+ if target:get("enabled") == false then
+ return
+ end
+
-- build target with rules
local done = false
for _, r in ipairs(target:orderules()) do
@@ -122,6 +127,13 @@ function _install_target(target)
{
target:script("install_before")
, function (target)
+
+ -- has been disabled?
+ if target:get("enabled") == false then
+ return
+ end
+
+ -- install rules
for _, r in ipairs(target:orderules()) do
local before_install = r:script("install_before")
if before_install then
@@ -131,6 +143,13 @@ function _install_target(target)
end
, target:script("install", _on_install)
, function (target)
+
+ -- has been disabled?
+ if target:get("enabled") == false then
+ return
+ end
+
+ -- install rules
for _, r in ipairs(target:orderules()) do
local after_install = r:script("install_after")
if after_install then
diff --git a/xmake/actions/run/main.lua b/xmake/actions/run/main.lua
index bb3ed7ac5..acc0cd3de 100644
--- a/xmake/actions/run/main.lua
+++ b/xmake/actions/run/main.lua
@@ -34,6 +34,11 @@ import("devel.debugger")
-- run target
function _on_run_target(target)
+ -- has been disabled?
+ if target:get("enabled") == false then
+ return
+ end
+
-- build target with rules
local done = false
for _, r in ipairs(target:orderules()) do
@@ -97,6 +102,13 @@ function _run(target)
{
target:script("run_before")
, function (target)
+
+ -- has been disabled?
+ if target:get("enabled") == false then
+ return
+ end
+
+ -- run rules
for _, r in ipairs(target:orderules()) do
local before_run = r:script("run_before")
if before_run then
@@ -106,6 +118,13 @@ function _run(target)
end
, target:script("run", _on_run_target)
, function (target)
+
+ -- has been disabled?
+ if target:get("enabled") == false then
+ return
+ end
+
+ -- run rules
for _, r in ipairs(target:orderules()) do
local after_run = r:script("run_after")
if after_run then
diff --git a/xmake/actions/uninstall/uninstall.lua b/xmake/actions/uninstall/uninstall.lua
index fc7303b2d..818136414 100644
--- a/xmake/actions/uninstall/uninstall.lua
+++ b/xmake/actions/uninstall/uninstall.lua
@@ -69,6 +69,11 @@ end
-- uninstall target
function _on_uninstall(target)
+ -- has been disabled?
+ if target:get("enabled") == false then
+ return
+ end
+
-- build target with rules
local done = false
for _, r in ipairs(target:orderules()) do
@@ -106,6 +111,13 @@ function _uninstall_target(target)
{
target:script("uninstall_before")
, function (target)
+
+ -- has been disabled?
+ if target:get("enabled") == false then
+ return
+ end
+
+ -- uninstall rules
for _, r in ipairs(target:orderules()) do
local before_uninstall = r:script("uninstall_before")
if before_uninstall then
@@ -115,6 +127,13 @@ function _uninstall_target(target)
end
, target:script("uninstall", _on_uninstall)
, function (target)
+
+ -- has been disabled?
+ if target:get("enabled") == false then
+ return
+ end
+
+ -- uninstall rules
for _, r in ipairs(target:orderules()) do
local after_uninstall = r:script("uninstall_after")
if after_uninstall then