summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2025-08-26 22:37:08 +0800
committerruki <[email protected]>2025-08-26 22:37:08 +0800
commit72493a7ed90b01a730e1712971f7ab7d3105219e (patch)
tree8e3d78aee8b85717e186bc9e48f517837f2d954f
parent57a0f0e067544e6d4767a4fa37102ce949d465e3 (diff)
improve to download packages #6654
-rw-r--r--xmake/actions/require/xmake.lua2
-rw-r--r--xmake/modules/private/action/require/download.lua2
-rw-r--r--xmake/modules/private/xrepo/action/download.lua4
3 files changed, 6 insertions, 2 deletions
diff --git a/xmake/actions/require/xmake.lua b/xmake/actions/require/xmake.lua
index 05af9e223..77c56f784 100644
--- a/xmake/actions/require/xmake.lua
+++ b/xmake/actions/require/xmake.lua
@@ -52,7 +52,7 @@ task("require")
, {'j', "jobs", "kv", tostring(os.default_njob()),
"Set the number of parallel compilation jobs." }
, {nil, "linkjobs", "kv", nil, "Set the number of parallel link jobs." }
- , {nil, "shallow", "k", nil, "Does not install dependent packages." }
+ , {nil, "shallow", "k", nil, "Does not install or download dependent packages." }
, {nil, "build", "k", nil, "Always build and install packages from source." }
, {'l', "list", "k", nil, "List all package dependencies in project.",
"e.g.",
diff --git a/xmake/modules/private/action/require/download.lua b/xmake/modules/private/action/require/download.lua
index 5aaad4d7a..f228d30ea 100644
--- a/xmake/modules/private/action/require/download.lua
+++ b/xmake/modules/private/action/require/download.lua
@@ -53,7 +53,7 @@ function main(requires_raw)
-- download packages
environment.enter()
- download_packages(requires, {requires_extra = requires_extra, nodeps = true})
+ download_packages(requires, {requires_extra = requires_extra, nodeps = option.get("shallow")})
environment.leave()
end
diff --git a/xmake/modules/private/xrepo/action/download.lua b/xmake/modules/private/xrepo/action/download.lua
index 869cd3d33..e792fbb96 100644
--- a/xmake/modules/private/xrepo/action/download.lua
+++ b/xmake/modules/private/xrepo/action/download.lua
@@ -49,6 +49,7 @@ function menu_options()
" - xrepo download -p cross --toolchain=mytool --includes='toolchain1.lua" .. path.envsep() .. "toolchain2.lua'" },
{category = "Other Configuration" },
{nil, "force", "k", nil, "Force to redownload all packages." },
+ {nil, "shallow", "k", nil, "Does not download dependent packages." },
{'o', "outputdir", "kv", "packages","Set the packages download output directory." },
{ },
{nil, "packages", "vs", nil, "The packages list.",
@@ -178,6 +179,9 @@ function _download_packages(packages)
if option.get("force") then
table.insert(require_argv, "--force")
end
+ if option.get("shallow") then
+ table.insert(require_argv, "--shallow")
+ end
local outputdir = option.get("outputdir")
if outputdir then
if not path.is_absolute(outputdir) then