summaryrefslogtreecommitdiff
path: root/xmake/rules/xcode/application/xmake.lua
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/rules/xcode/application/xmake.lua')
-rw-r--r--xmake/rules/xcode/application/xmake.lua20
1 files changed, 20 insertions, 0 deletions
diff --git a/xmake/rules/xcode/application/xmake.lua b/xmake/rules/xcode/application/xmake.lua
index 756d94d6c..2378775b3 100644
--- a/xmake/rules/xcode/application/xmake.lua
+++ b/xmake/rules/xcode/application/xmake.lua
@@ -47,6 +47,23 @@ rule("xcode.application")
-- imports
import("private.tools.codesign")
+ -- generate Info.plist
+ local function _gen_info_plist(info_plist_file)
+ io.gsub(info_plist_file, "(%$%((.-)%))", function (_, variable)
+ local maps =
+ {
+ DEVELOPMENT_LANGUAGE = "en",
+ EXECUTABLE_NAME = target:basename(),
+ PRODUCT_BUNDLE_IDENTIFIER = "org.tboox." .. target:name(),
+ PRODUCT_NAME = target:name(),
+ PRODUCT_BUNDLE_PACKAGE_TYPE = "APPL", -- application
+ CURRENT_PROJECT_VERSION = target:version() and tostring(target:version()) or "1.0",
+ MACOSX_DEPLOYMENT_TARGET = get_config("target_minver")
+ }
+ return maps[variable]
+ end)
+ end
+
-- get app directory
local appdir = path.absolute(target:data("xcode.appdir"))
@@ -67,6 +84,9 @@ rule("xcode.application")
local dstfile = dstfiles[i]
if dstfile then
os.vcp(srcfile, dstfile)
+ if path.filename(srcfile) == "Info.plist" then
+ _gen_info_plist(dstfile)
+ end
end
i = i + 1
end