diff options
| author | ruki <[email protected]> | 2020-04-19 15:51:27 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-04-19 15:51:27 +0800 |
| commit | af27042d57fb0b4603d22c4f15121c87fec6894d (patch) | |
| tree | 1085714326024d1929ea39209b06e06cfa65af49 | |
| parent | c8fcfc0da2a9e92a3b0d7af668561ee41f73564b (diff) | |
improve to deploy qt/android
| -rw-r--r-- | xmake/rules/qt/deploy/android.lua | 13 | ||||
| -rw-r--r-- | xmake/rules/qt/deploy/macosx.lua | 2 |
2 files changed, 14 insertions, 1 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 diff --git a/xmake/rules/qt/deploy/macosx.lua b/xmake/rules/qt/deploy/macosx.lua index 860d22c71..b0a3c08a5 100644 --- a/xmake/rules/qt/deploy/macosx.lua +++ b/xmake/rules/qt/deploy/macosx.lua @@ -69,7 +69,7 @@ function main(target, opt) local targetfile = target:targetfile() local dependfile = target:dependfile(target_app) local dependinfo = option.get("rebuild") and {} or (depend.load(dependfile) or {}) - if not depend.is_changed(dependinfo, {lastmtime = os.mtime(target_app)}) then + if not depend.is_changed(dependinfo, {lastmtime = os.mtime(dependfile)}) then return end |
