summaryrefslogtreecommitdiff
path: root/xmake/rules/xcode/framework
diff options
context:
space:
mode:
authorruki <[email protected]>2020-04-05 14:32:36 +0800
committerruki <[email protected]>2020-04-05 14:32:36 +0800
commit79ff6aed24ebfda2ecd4628b2237b75a003e347a (patch)
tree7a901d3fd0400e7926b9e5ba39ce627bae640a81 /xmake/rules/xcode/framework
parent903821ab225794e65e1fdee98afce2a566fe0f14 (diff)
improve info.plist
Diffstat (limited to 'xmake/rules/xcode/framework')
-rw-r--r--xmake/rules/xcode/framework/xmake.lua19
1 files changed, 19 insertions, 0 deletions
diff --git a/xmake/rules/xcode/framework/xmake.lua b/xmake/rules/xcode/framework/xmake.lua
index 304ba0ea0..6cc5ec1c7 100644
--- a/xmake/rules/xcode/framework/xmake.lua
+++ b/xmake/rules/xcode/framework/xmake.lua
@@ -72,6 +72,22 @@ rule("xcode.framework")
-- 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 = "FMWK", -- framework
+ CURRENT_PROJECT_VERSION = target:version() and tostring(target:version()) or "1.0"
+ }
+ return maps[variable]
+ end)
+ end
+
-- get framework directory
local frameworkdir = path.absolute(target:data("xcode.frameworkdir"))
local headersdir = path.join(frameworkdir, "Versions", "A", "Headers")
@@ -90,6 +106,9 @@ rule("xcode.framework")
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