summaryrefslogtreecommitdiff
path: root/xmake/rules/xcode/application/build.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2020-04-08 23:44:59 +0800
committerruki <[email protected]>2020-04-08 16:29:55 +0800
commitefe6609bb668d34a4beb5b9b06f36b7556796c7b (patch)
tree747263b31b08cb644fee54b24e855870564f06ae /xmake/rules/xcode/application/build.lua
parentef120036428f173d235b1822a242173b12c7a6b8 (diff)
improve xcode.app rule
Diffstat (limited to 'xmake/rules/xcode/application/build.lua')
-rw-r--r--xmake/rules/xcode/application/build.lua30
1 files changed, 5 insertions, 25 deletions
diff --git a/xmake/rules/xcode/application/build.lua b/xmake/rules/xcode/application/build.lua
index c67ef8058..73e49eff4 100644
--- a/xmake/rules/xcode/application/build.lua
+++ b/xmake/rules/xcode/application/build.lua
@@ -24,29 +24,12 @@ import("core.theme.theme")
import("core.project.depend")
import("private.tools.codesign")
--- generate Info.plist
-function _gen_info_plist(target, 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
-
-- main entry
function main (target, opt)
- -- get app and contents directory
+ -- get app and resources directory
local appdir = path.absolute(target:data("xcode.bundle.rootdir"))
- local contentsdir = path.absolute(target:data("xcode.bundle.contentsdir"))
+ local resourcesdir = path.absolute(target:data("xcode.bundle.resourcesdir"))
-- need re-compile it?
local dependfile = target:dependfile(appdir)
@@ -64,19 +47,16 @@ function main (target, opt)
end
-- copy PkgInfo to the contents directory
- os.cp(path.join(os.programdir(), "scripts", "PkgInfo"), contentsdir)
+ os.cp(path.join(os.programdir(), "scripts", "PkgInfo"), resourcesdir)
- -- copy resource files to the contents directory
- local srcfiles, dstfiles = target:installfiles(contentsdir)
+ -- copy resource files to the resources directory
+ local srcfiles, dstfiles = target:installfiles(resourcesdir)
if srcfiles and dstfiles then
local i = 1
for _, srcfile in ipairs(srcfiles) do
local dstfile = dstfiles[i]
if dstfile then
os.vcp(srcfile, dstfile)
- if path.filename(srcfile) == "Info.plist" then
- _gen_info_plist(target, dstfile)
- end
end
i = i + 1
end