- toolcontext.exec_and_check(["ant", "-q", "debug", "-f", android_project_root+"/build.xml"])
+ var args = ["ant", "-q", "-f", android_project_root+"/build.xml"]
+ if release then
+ args.add "release"
+ else args.add "debug"
+ toolcontext.exec_and_check(args, "Android project error")
+
+ # Move the apk to the target
+ var outname = toolcontext.opt_output.value
+ if outname == null then outname = "{compiler.mainmodule.name}.apk"
+
+ var src_apk_suffix
+ if release then
+ src_apk_suffix = "release-unsigned"
+ else src_apk_suffix = "debug"
+
+ toolcontext.exec_and_check(["mv", "{android_project_root}/bin/{compiler.mainmodule.name}-{src_apk_suffix}.apk", outname], "Android project error")
+ 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