diff options
| author | ruki <[email protected]> | 2021-04-15 00:45:04 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-04-15 00:45:04 +0800 |
| commit | 8d0bbc7f0dd19c61931cf1d22a147b199a5fe8e2 (patch) | |
| tree | 6187f57bee9d2c9be97979912b35a63ceeff2e91 | |
| parent | e2f886e49eb5d6047410e9990db77dadb6984b9d (diff) | |
modify exportdir argument
| -rw-r--r-- | xmake/actions/require/xmake.lua | 2 | ||||
| -rw-r--r-- | xmake/modules/private/action/require/export.lua | 4 | ||||
| -rw-r--r-- | xmake/modules/private/action/require/impl/export_packages.lua | 6 | ||||
| -rw-r--r-- | xmake/modules/private/xrepo/action/export.lua | 12 |
4 files changed, 12 insertions, 12 deletions
diff --git a/xmake/actions/require/xmake.lua b/xmake/actions/require/xmake.lua index a5104ce1e..f8487939e 100644 --- a/xmake/actions/require/xmake.lua +++ b/xmake/actions/require/xmake.lua @@ -81,7 +81,7 @@ task("require") " $ xmake require --export tbox zlib", " $ xmake require --export --exportdir=packagesdir zlib", " $ xmake require --export --extra=\"{debug=true}\" tbox" } - , {nil, "exportdir", "kv", "packages","Set the exported packages directory." } + , {nil, "packagedir", "kv", "packages","Set the packages directory for exporting and importing." } , {nil, "extra", "kv", nil, "Set the extra info of packages." } , { } , {nil, "requires", "vs", nil, "The package requires.", diff --git a/xmake/modules/private/action/require/export.lua b/xmake/modules/private/action/require/export.lua index 8c550a4c3..34052d71e 100644 --- a/xmake/modules/private/action/require/export.lua +++ b/xmake/modules/private/action/require/export.lua @@ -45,8 +45,8 @@ function main(requires_raw) end -- export packages - local exportdir = option.get("exportdir") - local packages = export_packages(requires, {requires_extra = requires_extra, exportdir = exportdir}) + local packagedir = option.get("packagedir") + local packages = export_packages(requires, {requires_extra = requires_extra, packagedir = packagedir}) if not packages or #packages == 0 then cprint("${bright}packages(%s) not found, maybe they don’t exactly match the configuration.", table.concat(requires_raw, ", ")) if os.getenv("XREPO_WORKING") then diff --git a/xmake/modules/private/action/require/impl/export_packages.lua b/xmake/modules/private/action/require/impl/export_packages.lua index 722a80a9a..36f9fc792 100644 --- a/xmake/modules/private/action/require/impl/export_packages.lua +++ b/xmake/modules/private/action/require/impl/export_packages.lua @@ -28,8 +28,8 @@ function main(requires, opt) -- init options opt = opt or {} - -- get the export directory - local exportdir = assert(opt.exportdir) + -- get the package directory + local packagedir = assert(opt.packagedir) -- export all packages local packages = {} @@ -38,7 +38,7 @@ function main(requires, opt) -- get export path local installdir = instance:installdir() local rootdir = core_package.installdir() - local exportpath, count = installdir:replace(rootdir, exportdir, {plain = true}) + local exportpath, count = installdir:replace(rootdir, packagedir, {plain = true}) -- export this package if exportpath and count == 1 and instance:fetch() then diff --git a/xmake/modules/private/xrepo/action/export.lua b/xmake/modules/private/xrepo/action/export.lua index 10e8b9a5a..ccd829328 100644 --- a/xmake/modules/private/xrepo/action/export.lua +++ b/xmake/modules/private/xrepo/action/export.lua @@ -41,7 +41,7 @@ function menu_options() " - xrepo export -f \"vs_runtime=MD\" zlib", " - xrepo export -f \"regex=true,thread=true\" boost"}, {}, - {'o', "outputdir", "kv", "packages","Set the exported packages directory."}, + {'o', "packagedir", "kv", "packages","Set the exported packages directory."}, {nil, "packages", "vs", nil, "The packages list.", "e.g.", " - xrepo export zlib boost", @@ -122,12 +122,12 @@ function _export_packages(packages) if option.get("diagnosis") then table.insert(require_argv, "-D") end - local outputdir = option.get("outputdir") - if outputdir and not path.is_absolute(outputdir) then - outputdir = path.absolute(outputdir, oldir) + local packagedir = option.get("packagedir") + if packagedir and not path.is_absolute(packagedir) then + packagedir = path.absolute(packagedir, oldir) end - if outputdir then - table.insert(require_argv, "--exportdir=" .. outputdir) + if packagedir then + table.insert(require_argv, "--packagedir=" .. packagedir) end local extra = {system = false} if mode == "debug" then |
