summaryrefslogtreecommitdiff
path: root/xmake/scripts/action/_package.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2015-06-30 10:45:41 +0800
committerruki <[email protected]>2015-06-30 10:45:41 +0800
commita9da9dee9f83abfe04ffbbd865156494c135161e (patch)
tree69b4ef596e9a4e815635e1ea77cd8a90aa215f17 /xmake/scripts/action/_package.lua
parentac86a19928d72a69a1ddd4802479393c717352e4 (diff)
make universal target for iphoneos
Diffstat (limited to 'xmake/scripts/action/_package.lua')
-rw-r--r--xmake/scripts/action/_package.lua14
1 files changed, 9 insertions, 5 deletions
diff --git a/xmake/scripts/action/_package.lua b/xmake/scripts/action/_package.lua
index 6743a140d..3fc9f6e4b 100644
--- a/xmake/scripts/action/_package.lua
+++ b/xmake/scripts/action/_package.lua
@@ -150,20 +150,24 @@ function _package._makeconf(target_name, target)
configs_arch.targetfile = _package._backup(configs_arch.targetdir, rule.targetfile(target_name, target))
-- save the package script
- configs_target.pkgscript = target.pkgscript
- if type(configs_target.pkgscript) == "string" and os.isfile(configs_target.pkgscript) then
- local script, errors = loadfile(configs_target.pkgscript)
+ local pkgscript = target.pkgscript
+ if type(pkgscript) == "string" and os.isfile(pkgscript) then
+ local script, errors = loadfile(pkgscript)
if script then
- configs_target.pkgscript = script()
+ pkgscript = script()
+ if type(pkgscript) == "table" and pkgscript.main then
+ pkgscript = pkgscript.main
+ end
else
utils.error(errors)
return false
end
end
- if target.pkgscript and type(configs_target.pkgscript) ~= "function" then
+ if target.pkgscript and type(pkgscript) ~= "function" then
utils.error("invalid package script!")
return false
end
+ configs_target.pkgscript = pkgscript
-- ok
return true