nitg/android: move generate apk file (with -o or locally)
authorAlexis Laferrière <alexis.laf@xymus.net>
Fri, 7 Mar 2014 22:16:37 +0000 (17:16 -0500)
committerAlexis Laferrière <alexis.laf@xymus.net>
Sat, 8 Mar 2014 04:20:40 +0000 (23:20 -0500)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

src/android_platform.nit

index aace0c0..d888a32 100644 (file)
@@ -219,5 +219,10 @@ $(call import-module,android/native_app_glue)
 
                # Generate the apk
                toolcontext.exec_and_check(["ant", "-q", "debug", "-f", android_project_root+"/build.xml"])
+
+               # Move the apk to the target
+               var outname = toolcontext.opt_output.value
+               if outname == null then outname = "{compiler.mainmodule.name}.apk"
+               toolcontext.exec_and_check(["mv", "{android_project_root}/bin/{compiler.mainmodule.name}-debug.apk", outname])
        end
 end