diff options
| author | ruki <[email protected]> | 2021-06-19 00:40:00 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-06-19 00:40:00 +0800 |
| commit | abcb36d06cf324c64968606950ec7c586dbafa61 (patch) | |
| tree | 673e707b6000cb8ad92d22d7b8903d16710387dc | |
| parent | 702a976d93950d6079665e412137ae17e82563a0 (diff) | |
add shallow to export packages without deps
| -rw-r--r-- | xmake/modules/private/action/require/export.lua | 3 | ||||
| -rw-r--r-- | xmake/modules/private/xrepo/action/export.lua | 6 |
2 files changed, 7 insertions, 2 deletions
diff --git a/xmake/modules/private/action/require/export.lua b/xmake/modules/private/action/require/export.lua index 45ead32fd..0906cf4aa 100644 --- a/xmake/modules/private/action/require/export.lua +++ b/xmake/modules/private/action/require/export.lua @@ -46,7 +46,8 @@ function main(requires_raw) -- export packages local packagedir = option.get("packagedir") - local packages = export_packages(requires, {requires_extra = requires_extra, packagedir = packagedir}) + local nodeps = option.get("shallow") and true or false + local packages = export_packages(requires, {requires_extra = requires_extra, packagedir = packagedir, nodeps = nodeps}) if not packages or #packages == 0 then if requires_raw then cprint("${bright}packages(%s) not found, maybe they don’t exactly match the configuration ", table.concat(requires_raw, ", ")) diff --git a/xmake/modules/private/xrepo/action/export.lua b/xmake/modules/private/xrepo/action/export.lua index e8054afcb..4c2e8c445 100644 --- a/xmake/modules/private/xrepo/action/export.lua +++ b/xmake/modules/private/xrepo/action/export.lua @@ -42,7 +42,8 @@ function menu_options() " - xrepo export -f \"vs_runtime=MD\" zlib", " - xrepo export -f \"regex=true,thread=true\" boost"}, {}, - {'o', "packagedir", "kv", "packages","Set the exported packages directory."}, + {nil, "shallow", "k", nil, "Does not export dependent packages."}, + {'o', "packagedir", "kv", "packages","Set the exported packages directory."}, {nil, "packages", "vs", nil, "The packages list.", "e.g.", " - xrepo export zlib boost", @@ -121,6 +122,9 @@ function _export_packages(packages) if option.get("diagnosis") then table.insert(require_argv, "-D") end + if option.get("shallow") then + table.insert(require_argv, "--shallow") + end local packagedir = option.get("packagedir") if packagedir and not path.is_absolute(packagedir) then packagedir = path.absolute(packagedir, oldir) |
