diff options
| author | ruki <[email protected]> | 2023-11-24 23:09:46 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-11-24 23:09:46 +0800 |
| commit | 51efaa718683a9bf18cd6859e60f1d5240c10c5d (patch) | |
| tree | 0ae3485ef5434f8acfc70210b6910356aa5adfc5 /xmake/plugins/pack/archive.lua | |
| parent | 16f74fe53b4c240c8bee69e1d06dc821067f2817 (diff) | |
| parent | 43ac546cbd551bf06ae37a8211c8a65d9eadbb0b (diff) | |
Merge pull request #4415 from xmake-io/makeself
pack runself
Diffstat (limited to 'xmake/plugins/pack/archive.lua')
| -rw-r--r-- | xmake/plugins/pack/archive.lua | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/xmake/plugins/pack/archive.lua b/xmake/plugins/pack/archive.lua index 818404345..dd1861ca4 100644 --- a/xmake/plugins/pack/archive.lua +++ b/xmake/plugins/pack/archive.lua @@ -26,16 +26,32 @@ import("batchcmds") -- pack archive package function _pack_archive(package) - -- do install - batchcmds.get_installcmds(package):runcmds() - for _, component in table.orderpairs(package:components()) do - if component:get("default") ~= false then - batchcmds.get_installcmds(component):runcmds() + -- archive source files + if package:from_source() then + local srcfiles, dstfiles = package:sourcefiles() + for idx, srcfile in ipairs(srcfiles) do + os.vcp(srcfile, dstfiles[idx]) + end + for _, component in table.orderpairs(package:components()) do + if component:get("default") ~= false then + local srcfiles, dstfiles = component:sourcefiles() + for idx, srcfile in ipairs(srcfiles) do + os.vcp(srcfile, dstfiles[idx]) + end + end + end + else + -- archive binary files + batchcmds.get_installcmds(package):runcmds() + for _, component in table.orderpairs(package:components()) do + if component:get("default") ~= false then + batchcmds.get_installcmds(component):runcmds() + end end end -- archive install files - local rootdir = package:rootdir() + local rootdir = package:from_source() and package:source_rootdir() or package:install_rootdir() local oldir = os.cd(rootdir) local archivefiles = os.files("**") os.cd(oldir) |
