auto_super_init: handle the case of constructors redefinition (instead of infinitivel...
[nit.git] / src / android_platform.nit
index de0bec5..8532cf8 100644 (file)
@@ -19,6 +19,7 @@ module android_platform
 import platform
 import abstract_compiler
 import common_ffi
+intrude import common_ffi::extra_java_files
 import android_annotations
 
 redef class ToolContext
@@ -120,6 +121,14 @@ class AndroidToolchain
                        icon_declaration = "android:icon=\"@drawable/icon\""
                else icon_declaration = ""
 
+               # Also copy over the java files
+               dir = "{android_project_root}/src/"
+               var extra_java_files = compiler.mainmodule.extra_java_files
+               if extra_java_files != null then for file in extra_java_files do
+                       var path = file.filename
+                       path.file_copy_to("{dir}/{path.basename("")}")
+               end
+
                ## Generate delagating makefile
                dir = "{android_project_root}/jni/"
                """
@@ -261,7 +270,7 @@ $(call import-module,android/native_app_glue)
                var release = toolcontext.opt_release.value
 
                # Compile C code (and thus Nit)
-               toolcontext.exec_and_check(["ndk-build", "-s", "-j", "4", "-C", android_project_root], "Android project error")
+               toolcontext.exec_and_check(["ndk-build", "-s", "-j", "-C", android_project_root], "Android project error")
 
                # Generate the apk
                var args = ["ant", "-q", "-f", android_project_root+"/build.xml"]