diff options
| author | ruki <[email protected]> | 2020-04-05 13:07:33 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-04-05 13:07:33 +0800 |
| commit | e2d21dbde6020a5e36d7c862d92efdbae1f54033 (patch) | |
| tree | 4ec9ec83b34813e2c135b916d704c7e9d4545ebd | |
| parent | 7e23b2f6e8920f1f95c48908db5f88161d2c4d01 (diff) | |
do codesign for qt.deploy
| -rw-r--r-- | xmake/rules/qt/deploy/macosx.lua | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/xmake/rules/qt/deploy/macosx.lua b/xmake/rules/qt/deploy/macosx.lua index 868b10ecb..fa7c5e81f 100644 --- a/xmake/rules/qt/deploy/macosx.lua +++ b/xmake/rules/qt/deploy/macosx.lua @@ -22,11 +22,21 @@ import("core.theme.theme") import("core.base.option") import("core.project.config") +import("core.project.depend") import("lib.detect.find_path") -- deploy application package for macosx function main(target, opt) + -- need re-generate this app? + local target_app = path.join(target:targetdir(), target:basename() .. ".app") + 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 + return + end + -- trace progress info cprintf("${color.build.progress}" .. theme.get("text.build.progress_format") .. ":${clear} ", opt.progress) if option.get("verbose") then @@ -43,13 +53,12 @@ function main(target, opt) assert(os.isexec(macdeployqt), "macdeployqt not found!") -- generate target app - local target_app = path.join(target:targetdir(), target:basename() .. ".app") local target_contents = path.join(target_app, "Contents") os.tryrm(target_app) os.cp(target:targetfile(), path.join(target_contents, "MacOS", target:basename())) os.cp(path.join(os.programdir(), "scripts", "PkgInfo"), target_contents) - -- TODO generate Info.plist and codesign + -- TODO generate Info.plist -- find qml directory local qmldir = nil @@ -76,6 +85,15 @@ function main(target, opt) if qmldir then table.insert(argv, "-qmldir=" .. qmldir) end + local codesign_identity = target:values("xcode.codesign_identity") + if codesign_identity then + -- e.g. "Apple Development: [email protected] (T3NA4MRVPU)" + table.insert(argv, "-codesign=" .. codesign_identity) + end os.vrunv(macdeployqt, argv) + + -- update files and values to the dependent file + dependinfo.files = {targetfile} + depend.save(dependinfo, dependfile) end |
