summaryrefslogtreecommitdiff
path: root/xmake/rules/qt/deploy/android.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2020-04-19 15:51:27 +0800
committerruki <[email protected]>2020-04-19 15:51:27 +0800
commitaf27042d57fb0b4603d22c4f15121c87fec6894d (patch)
tree1085714326024d1929ea39209b06e06cfa65af49 /xmake/rules/qt/deploy/android.lua
parentc8fcfc0da2a9e92a3b0d7af668561ee41f73564b (diff)
improve to deploy qt/android
Diffstat (limited to 'xmake/rules/qt/deploy/android.lua')
-rw-r--r--xmake/rules/qt/deploy/android.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/xmake/rules/qt/deploy/android.lua b/xmake/rules/qt/deploy/android.lua
index a4c6b621e..dd19e7318 100644
--- a/xmake/rules/qt/deploy/android.lua
+++ b/xmake/rules/qt/deploy/android.lua
@@ -23,6 +23,7 @@ import("core.theme.theme")
import("core.base.option")
import("core.base.semver")
import("core.project.config")
+import("core.project.depend")
-- escape path
function _escape_path(p)
@@ -35,6 +36,14 @@ function main(target, opt)
-- get target apk path
local target_apk = path.join(target:targetdir(), target:basename() .. ".apk")
+ -- need re-generate this apk?
+ local targetfile = target:targetfile()
+ local dependfile = target:dependfile(target_apk)
+ 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
@@ -198,5 +207,9 @@ function main(target, opt)
-- show apk output path
vprint("the apk output path: %s", target_apk)
+
+ -- update files and values to the dependent file
+ dependinfo.files = {targetfile}
+ depend.save(dependinfo, dependfile)
end