nitc iOS: fix moving binary in release compilation mode
authorAlexis Laferrière <alexis.laf@xymus.net>
Fri, 9 Sep 2016 14:34:37 +0000 (10:34 -0400)
committerAlexis Laferrière <alexis.laf@xymus.net>
Fri, 9 Sep 2016 15:48:09 +0000 (11:48 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

src/platform/ios.nit

index 3178b49..d8a68a9 100644 (file)
@@ -166,10 +166,11 @@ private class IOSToolchain
                # Compile with `xcodebuild`
                #
                # TODO support more than the iPhone and the simulator.
+               var compile_mode = if release then "Release" else "Debug"
                var args = ["sh", "-c", "cd {ios_project_root}; " +
                        "xcodebuild -target '{project_name}' " +
                        "-destination 'platform=iOS Simulator,name=iPhone' " +
-                       "-configuration {if release then "Release" else "Debug"} " +
+                       "-configuration {compile_mode} " +
                         "ONLY_ACTIVE_ARCH=NO "+
                        "-sdk iphonesimulator build"]
                toolcontext.exec_and_check(args, "iOS project error")
@@ -183,7 +184,7 @@ private class IOSToolchain
                        end
                end
 
-               args = ["mv", "{ios_project_root}/build/Debug-iphonesimulator/{project_name}.app", outfile]
+               args = ["mv", "{ios_project_root}/build/{compile_mode}-iphonesimulator/{project_name}.app", outfile]
                toolcontext.exec_and_check(args, "iOS project error")
        end
 end