From 95e6e378d5880445931e155c70e1fae0ab75b5d5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexis=20Laferri=C3=A8re?= Date: Thu, 21 Jul 2016 23:22:20 -0400 Subject: [PATCH 1/1] iOS: use `app_files` MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Alexis Laferrière --- src/platform/ios.nit | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/src/platform/ios.nit b/src/platform/ios.nit index c221598..76fefea 100644 --- a/src/platform/ios.nit +++ b/src/platform/ios.nit @@ -95,15 +95,22 @@ private class IOSToolchain end end - var icon_dir = project_root / "ios" / "AppIcon.appiconset" - var icons_found = icon_dir.file_exists - if icons_found then + # Copy all resources + var app_files = [project_root] + app_files.add_all app_project.files + + var icons_found = false - # Prepare the `Assets.xcassets` folder - var target_assets_dir = compile_dir / "Assets.xcassets" - if not target_assets_dir.file_exists then target_assets_dir.mkdir + for path in app_files do + var icon_dir = path / "ios" / "AppIcon.appiconset" + if icon_dir.file_exists then + icons_found = true - """ + # Prepare the `Assets.xcassets` folder + var target_assets_dir = compile_dir / "Assets.xcassets" + if not target_assets_dir.file_exists then target_assets_dir.mkdir + + """ { "info" : { "version" : 1, @@ -111,9 +118,10 @@ private class IOSToolchain } }""".write_to_file target_assets_dir / "Contents.json" - # copy the res folder to the compile dir - icon_dir = icon_dir.realpath - toolcontext.exec_and_check(["cp", "-R", icon_dir, target_assets_dir], "iOS project error") + # copy the res folder to the compile dir + icon_dir = icon_dir.realpath + toolcontext.exec_and_check(["cp", "-R", icon_dir, target_assets_dir], "iOS project error") + end end # TODO Register asset files -- 1.7.9.5