summaryrefslogtreecommitdiff
path: root/xmake/rules/xcode/application/build.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2020-04-08 23:36:02 +0800
committerruki <[email protected]>2020-04-08 15:36:16 +0800
commit4c12e160c53b2566f9c80a86d9f7350aee4f62b3 (patch)
treefb600880e30f684b9a4fe4eca9a549d092ea6bd2 /xmake/rules/xcode/application/build.lua
parent73323570007d4765824883c64036e72eabdab2cf (diff)
improve generate xcode.app
Diffstat (limited to 'xmake/rules/xcode/application/build.lua')
-rw-r--r--xmake/rules/xcode/application/build.lua24
1 files changed, 23 insertions, 1 deletions
diff --git a/xmake/rules/xcode/application/build.lua b/xmake/rules/xcode/application/build.lua
index 57f4c82b6..dfe6fcfc2 100644
--- a/xmake/rules/xcode/application/build.lua
+++ b/xmake/rules/xcode/application/build.lua
@@ -19,6 +19,9 @@
--
-- imports
+import("core.base.option")
+import("core.theme.theme")
+import("core.project.depend")
import("private.tools.codesign")
-- generate Info.plist
@@ -39,12 +42,27 @@ function _gen_info_plist(target, info_plist_file)
end
-- main entry
-function main (target)
+function main (target, opt)
-- get app and contents directory
local appdir = path.absolute(target:data("xcode.app.rootdir"))
local contentsdir = path.absolute(target:data("xcode.app.contentsdir"))
+ -- need re-compile it?
+ local dependfile = target:dependfile(appdir)
+ local dependinfo = option.get("rebuild") and {} or (depend.load(dependfile) or {})
+ if not depend.is_changed(dependinfo, {lastmtime = os.mtime(dependfile)}) then
+ return
+ end
+
+ -- trace progress info
+ cprintf("${color.build.progress}" .. theme.get("text.build.progress_format") .. ":${clear} ", opt.progress)
+ if option.get("verbose") then
+ cprint("${dim color.build.target}generating.xcode.app %s", path.filename(appdir))
+ else
+ cprint("${color.build.target}generating.xcode.app %s", path.filename(appdir))
+ end
+
-- copy PkgInfo to the contents directory
os.cp(path.join(os.programdir(), "scripts", "PkgInfo"), contentsdir)
@@ -66,5 +84,9 @@ function main (target)
-- do codesign
codesign(appdir, target:values("xcode.codesign_identity") or get_config("xcode_codesign_identity"))
+
+ -- update files and values to the dependent file
+ dependinfo.files = {appdir}
+ depend.save(dependinfo, dependfile)
end