diff options
| author | ruki <[email protected]> | 2020-04-08 23:34:09 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-04-08 15:24:59 +0800 |
| commit | 73323570007d4765824883c64036e72eabdab2cf (patch) | |
| tree | ddeaffa62543d8bdc2440f59ee700f7aaaa3c979 /xmake/rules/xcode | |
| parent | c472bf464c4af2532d574d1063e473863f1adb54 (diff) | |
support for building xcode.app/iphoneos
Diffstat (limited to 'xmake/rules/xcode')
| -rw-r--r-- | xmake/rules/xcode/application/build_file.lua | 26 | ||||
| -rw-r--r-- | xmake/rules/xcode/application/load.lua | 3 |
2 files changed, 26 insertions, 3 deletions
diff --git a/xmake/rules/xcode/application/build_file.lua b/xmake/rules/xcode/application/build_file.lua index 9045fc2d4..999dc8035 100644 --- a/xmake/rules/xcode/application/build_file.lua +++ b/xmake/rules/xcode/application/build_file.lua @@ -55,13 +55,28 @@ function _build_xcassets_file(target, sourcefile, opt) table.insert(argv, "mac") table.insert(argv, "--platform") table.insert(argv, "macosx") + elseif is_plat("iphoneos") then + table.insert(argv, "--target-device") + table.insert(argv, "iphone") + table.insert(argv, "--target-device") + table.insert(argv, "ipad") + table.insert(argv, "--platform") + table.insert(argv, "iphoneos") + else + assert("unknown device!") end table.insert(argv, "--minimum-deployment-target") table.insert(argv, get_config("target_minver")) table.insert(argv, "--app-icon") table.insert(argv, "AppIcon") - table.insert(argv, "--enable-on-demand-resources") - table.insert(argv, "NO") + if is_plat("iphoneos") then + table.insert(argv, "--enable-on-demand-resources") + table.insert(argv, "YES") + table.insert(argv, "--compress-pngs") + else + table.insert(argv, "--enable-on-demand-resources") + table.insert(argv, "NO") + end table.insert(argv, "--development-region") table.insert(argv, "en") table.insert(argv, "--product-type") @@ -109,6 +124,13 @@ function _build_storyboard_file(target, sourcefile, opt) if is_plat("macosx") then table.insert(argv, "--target-device") table.insert(argv, "mac") + elseif is_plat("iphoneos") then + table.insert(argv, "--target-device") + table.insert(argv, "iphone") + table.insert(argv, "--target-device") + table.insert(argv, "ipad") + else + assert("unknown device!") end table.insert(argv, "--minimum-deployment-target") table.insert(argv, get_config("target_minver")) diff --git a/xmake/rules/xcode/application/load.lua b/xmake/rules/xcode/application/load.lua index cb9da887a..4986d454f 100644 --- a/xmake/rules/xcode/application/load.lua +++ b/xmake/rules/xcode/application/load.lua @@ -28,10 +28,11 @@ function main (target) -- get contents and resources directory local contentsdir = appdir + local resourcesdir = appdir if is_plat("macosx") then contentsdir = path.join(appdir, "Contents") + resourcesdir = path.join(appdir, "Contents", "Resources") end - local resourcesdir = path.join(contentsdir, "Resources") target:data_set("xcode.app.contentsdir", contentsdir) target:data_set("xcode.app.resourcesdir", resourcesdir) |
