From 903821ab225794e65e1fdee98afce2a566fe0f14 Mon Sep 17 00:00:00 2001 From: ruki Date: Sun, 5 Apr 2020 13:18:56 +0800 Subject: improve mac qt/deploy --- xmake/rules/qt/deploy/macosx.lua | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/xmake/rules/qt/deploy/macosx.lua b/xmake/rules/qt/deploy/macosx.lua index fa7c5e81f..63c0ca1ff 100644 --- a/xmake/rules/qt/deploy/macosx.lua +++ b/xmake/rules/qt/deploy/macosx.lua @@ -25,6 +25,42 @@ import("core.project.config") import("core.project.depend") import("lib.detect.find_path") +-- save Info.plist +function _save_info_plist(target, info_plist_file) + + local name = target:basename() + io.writefile(info_plist_file, string.format([[ + + + + BuildMachineOSBuild + 18G95 + CFBundleDevelopmentRegion + en + CFBundleDisplayName + %s + CFBundleExecutable + %s + CFBundleIdentifier + org.example.%s + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + %s + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1.0.0 + LSMinimumSystemVersion + %s + NSPrincipalClass + NSApplication + +]], name, name, name, name, macos.version():major() .. "." .. macos.version():minor())) +end + -- deploy application package for macosx function main(target, opt) @@ -58,7 +94,8 @@ function main(target, opt) 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 + -- generate Info.plist + _save_info_plist(target, path.join(target_contents, "Info.plist")) -- find qml directory local qmldir = nil -- cgit v1.3.1