summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2019-05-11 00:30:54 +0800
committerruki <[email protected]>2019-05-10 21:05:28 +0800
commit22ee7732c80f018cf6f2a2943ec36b2f4fe4dadd (patch)
treec2b9ef9cc19f18d0d0fe2517af939cedd8d2dbd7
parent11a61399f708e73df2c47b31cf4fd4d3f16495bc (diff)
add shallow args for require
-rw-r--r--xmake/actions/require/impl/package.lua2
-rw-r--r--xmake/actions/require/xmake.lua1
2 files changed, 2 insertions, 1 deletions
diff --git a/xmake/actions/require/impl/package.lua b/xmake/actions/require/impl/package.lua
index b43e19280..10d71974f 100644
--- a/xmake/actions/require/impl/package.lua
+++ b/xmake/actions/require/impl/package.lua
@@ -362,7 +362,7 @@ function _load_packages(requires, opt)
if package then
-- load dependent packages and save them first of this package
- if not package._DEPS then
+ if not package._DEPS and not option.get("shallow") then
local deps = package:get("deps")
if deps and opt.nodeps ~= true then
local packagedeps = {}
diff --git a/xmake/actions/require/xmake.lua b/xmake/actions/require/xmake.lua
index e85aeb6ac..d612cc231 100644
--- a/xmake/actions/require/xmake.lua
+++ b/xmake/actions/require/xmake.lua
@@ -46,6 +46,7 @@ task("require")
" $ xmake require --clean",
" $ xmake require --clean zlib tbox pcr*" }
, {'f', "force", "k", nil, "Force to reinstall all package dependencies." }
+ , {nil, "shallow", "k", nil, "Only install the root packages." }
, {'l', "list", "k", nil, "List all package dependencies in project.",
"e.g.",
" $ xmake require --list" }