diff options
| author | ruki <[email protected]> | 2025-11-26 22:35:21 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-11-26 22:35:21 +0800 |
| commit | eba4c503ccaf873a87ec1f867ba3dffd98b45800 (patch) | |
| tree | 46f2b411563c64cafb5c30e74208258f57d0f6da /xmake/rules/xcode | |
| parent | fe96cdcbaa858ebcec0935d42b3409487e05e511 (diff) | |
improve app/on_installcmd
Diffstat (limited to 'xmake/rules/xcode')
| -rw-r--r-- | xmake/rules/xcode/application/installcmd.lua | 24 | ||||
| -rw-r--r-- | xmake/rules/xcode/application/xmake.lua | 2 |
2 files changed, 24 insertions, 2 deletions
diff --git a/xmake/rules/xcode/application/installcmd.lua b/xmake/rules/xcode/application/installcmd.lua index 39d64ab1c..c08a0fede 100644 --- a/xmake/rules/xcode/application/installcmd.lua +++ b/xmake/rules/xcode/application/installcmd.lua @@ -22,11 +22,16 @@ function main(target, batchcmds, opt) local package = opt.package - -- only for macosx when packing dmg + -- only for macosx when packing if not target:is_plat("macosx") then return end + -- only for xpack (package exists) + if not package then + return + end + -- get app directory local appdir = target:data("xcode.bundle.rootdir") if not appdir or not os.isdir(appdir) then @@ -44,5 +49,22 @@ function main(target, batchcmds, opt) local appname = path.filename(appdir) local dstappdir = path.join(installdir, appname) batchcmds:cp(appdir, dstappdir, {symlink = true}) + + -- install target files (skip binary installation) + local srcfiles, dstfiles = target:installfiles(installdir) + if srcfiles and dstfiles then + for idx, srcfile in ipairs(srcfiles) do + batchcmds:cp(srcfile, dstfiles[idx], {symlink = true}) + end + end + -- install dependent target files + for _, dep in ipairs(target:orderdeps()) do + local srcfiles, dstfiles = dep:installfiles(installdir, {interface = true}) + if srcfiles and dstfiles then + for idx, srcfile in ipairs(srcfiles) do + batchcmds:cp(srcfile, dstfiles[idx], {symlink = true}) + end + end + end end diff --git a/xmake/rules/xcode/application/xmake.lua b/xmake/rules/xcode/application/xmake.lua index d809261c5..8af79a585 100644 --- a/xmake/rules/xcode/application/xmake.lua +++ b/xmake/rules/xcode/application/xmake.lua @@ -37,7 +37,7 @@ rule("xcode.application") on_install("install") -- install application for xpack - after_installcmd("installcmd") + on_installcmd("installcmd") -- uninstall application on_uninstall("uninstall") |
