diff options
| author | ruki <[email protected]> | 2020-04-08 23:50:43 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-04-08 17:04:23 +0800 |
| commit | e3e74b6dccfa877981a26896519414eab44ee2a7 (patch) | |
| tree | 33e8c246483638206ef18a607cc59f28fb44a17c /xmake/rules/xcode/info_plist | |
| parent | efe6609bb668d34a4beb5b9b06f36b7556796c7b (diff) | |
improve xcode.framework rules
Diffstat (limited to 'xmake/rules/xcode/info_plist')
| -rw-r--r-- | xmake/rules/xcode/info_plist/xmake.lua | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/xmake/rules/xcode/info_plist/xmake.lua b/xmake/rules/xcode/info_plist/xmake.lua index 733079dcc..d499ec954 100644 --- a/xmake/rules/xcode/info_plist/xmake.lua +++ b/xmake/rules/xcode/info_plist/xmake.lua @@ -35,8 +35,9 @@ rule("xcode.info_plist") -- check assert(path.filename(sourcefile) == "Info.plist", "we only support Info.plist file!") - -- get contents directory + -- get contents and resources directory local contentsdir = assert(target:data("xcode.bundle.contentsdir"), "contents directory not found!") + local resourcesdir = assert(target:data("xcode.bundle.resourcesdir"), "resources directory not found!") -- need re-compile it? local dependfile = target:dependfile(sourcefile) @@ -54,17 +55,23 @@ rule("xcode.info_plist") end -- process and generate Info.plist - local info_plist_file = path.join(contentsdir, path.filename(sourcefile)) + local info_plist_file = path.join(target:rule("xcode.framework") and resourcesdir or contentsdir, path.filename(sourcefile)) 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") } + if target:rule("xcode.bundle") then + maps.PRODUCT_BUNDLE_PACKAGE_TYPE = "BNDL" + elseif target:rule("xcode.framework") then + maps.PRODUCT_BUNDLE_PACKAGE_TYPE = "FMWK" + elseif target:rule("xcode.application") then + maps.PRODUCT_BUNDLE_PACKAGE_TYPE = "APPL" + end os.vcp(sourcefile, info_plist_file) io.gsub(info_plist_file, "(%$%((.-)%))", function (_, variable) |
