online_ide: imports nitc (symlinked from contrib)
[nit.git] / src / platform / ios.nit
index f81b5d2..7ba038b 100644 (file)
@@ -36,21 +36,27 @@ private class IOSPlatform
        redef fun toolchain(toolcontext, compiler) do return new IOSToolchain(toolcontext, compiler)
 end
 
+private class IosProject
+       super AppProject
+
+       redef fun namespace do return super.to_camel_case
+end
+
 private class IOSToolchain
        super MakefileToolchain
 
-       # Root of the iOS project, usually `.nit_compile/ios/`
+       # Root of the iOS project, usually `nit_compile/ios/`
        var ios_project_root: String is noinit
 
        # `app.nit` project for the current compilation target
-       var app_project = new AppProject(compiler.modelbuilder, compiler.mainmodule) is lazy
+       var app_project = new IosProject(compiler.modelbuilder, compiler.mainmodule) is lazy
 
        redef fun default_outname do return "{super}.app"
 
        # Compile C files in `ios_project_root/app_project.name`
        redef fun compile_dir
        do
-               ios_project_root = super/"ios"
+               ios_project_root = root_compile_dir/"ios"
                return ios_project_root/app_project.short_name
        end
 
@@ -77,7 +83,7 @@ private class IOSToolchain
                ## Register all source files
                for file in cfiles do pbx.add_file new PbxFile(file)
                for file in compiler.extern_bodies do
-                       pbx.add_file new PbxFile(file.filename.basename(""))
+                       pbx.add_file new PbxFile(file.filename.basename)
                end
 
                ## TODO Register asset files
@@ -104,6 +110,7 @@ private class IOSToolchain
                        "xcodebuild -target '{project_name}' " +
                        "-destination 'platform=iOS Simulator,name=iPhone' " +
                        "-configuration {if release then "Release" else "Debug"} " +
+                        "ONLY_ACTIVE_ARCH=NO "+
                        "-sdk iphonesimulator build"]
                toolcontext.exec_and_check(args, "iOS project error")