summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2020-04-05 13:18:56 +0800
committerruki <[email protected]>2020-04-05 13:18:56 +0800
commit903821ab225794e65e1fdee98afce2a566fe0f14 (patch)
treef035fab1bce4cc24ed1a75be7637a1fb04a6348d
parente2d21dbde6020a5e36d7c862d92efdbae1f54033 (diff)
improve mac qt/deploy
-rw-r--r--xmake/rules/qt/deploy/macosx.lua39
1 files changed, 38 insertions, 1 deletions
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([[<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>BuildMachineOSBuild</key>
+ <string>18G95</string>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>en</string>
+ <key>CFBundleDisplayName</key>
+ <string>%s</string>
+ <key>CFBundleExecutable</key>
+ <string>%s</string>
+ <key>CFBundleIdentifier</key>
+ <string>org.example.%s</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>%s</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleVersion</key>
+ <string>1.0.0</string>
+ <key>LSMinimumSystemVersion</key>
+ <string>%s</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+</dict>
+</plist>]], 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