Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
#
# Will, in the near future, provide services specific to Android.
module android is platform
+
+import java
}
`}
end
+
+redef class Sys
+ # Get the running JVM
+ redef fun create_default_jvm
+ do
+ var jvm = ndk_jvm
+ var jni_env = jvm.attach_current_thread
+ if jni_env.address_is_null then jni_env = jvm.env
+
+ self.jvm = jvm
+ self.jni_env = jni_env
+ end
+
+ protected fun ndk_jvm: JavaVM `{ return mnit_java_app->activity->vm; `}
+end
import platform
import abstract_compiler
+import common_ffi
redef class ToolContext
redef fun platform_from_name(name)
toolcontext.exec_and_check(["mv", "{android_project_root}/bin/{compiler.mainmodule.name}-debug.apk", outname])
end
end
+
+redef class JavaClassTemplate
+ redef fun write_to_files(compdir)
+ do
+ var jni_path = "jni/nit_compile/"
+ if compdir.has_suffix(jni_path) then
+ var path = "{compdir.substring(0, compdir.length-jni_path.length)}/src/"
+ return super(path)
+ else return super
+ end
+end