diff options
| author | ruki <[email protected]> | 2020-02-18 00:36:03 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-02-17 21:36:23 +0800 |
| commit | 531e766aff537bcd24ab0d92583f9099bc6f8567 (patch) | |
| tree | 12eff83471fbef9f7acc8666b95dde9ee6d31c1a /xmake/actions/require/impl/package.lua | |
| parent | 077ff4050e3e60cb9c0d18a563a3c3ab76d4f1a1 (diff) | |
impl export packages
Diffstat (limited to 'xmake/actions/require/impl/package.lua')
| -rw-r--r-- | xmake/actions/require/impl/package.lua | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/xmake/actions/require/impl/package.lua b/xmake/actions/require/impl/package.lua index bf84b436c..5954c14ac 100644 --- a/xmake/actions/require/impl/package.lua +++ b/xmake/actions/require/impl/package.lua @@ -839,6 +839,29 @@ function export_packages(requires, opt) -- init options opt = opt or {} + + -- do not export dependent packages + opt.nodeps = true + + -- get the export directory + local exportdir = assert(opt.exportdir) + + -- export all packages + local packages = {} + for _, instance in ipairs(load_packages(requires, opt)) do + + -- get the exported name + local name = instance:name():lower():gsub("::", "_") + if instance:version_str() then + name = name .. "_" .. instance:version_str() + end + name = name .. "_" .. instance:buildhash() + + -- export this package + os.cp(instance:installdir(), path.join(exportdir, name)) + table.insert(packages, instance) + end + return packages end -- search packages |
