X-Git-Url: http://nitlanguage.org?ds=inline
diff --git a/src/android_platform.nit b/src/android_platform.nit
index bb3c270..6dc34f8 100644
--- a/src/android_platform.nit
+++ b/src/android_platform.nit
@@ -55,6 +55,8 @@ end
class AndroidPlatform
super Platform
+ redef fun supports_libunwind do return false
+
redef fun toolchain(toolcontext) do return new AndroidToolchain(toolcontext)
end
@@ -133,19 +135,24 @@ $(call import-module,android/native_app_glue)
package="{{{app_package}}}"
android:versionCode="1"
android:versionName="{{{app_version}}}"
- android:debuggable="true">
+ android:debuggable="true">
-
+
+ android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
+ android:configChanges="orientation|keyboardHidden"
+ android:screenOrientation="portrait">
@@ -192,6 +199,19 @@ $(call import-module,android/native_app_glue)
if not target_png_dir.file_exists then
toolcontext.exec_and_check(["ln", "-s", "{share_dir}/png/", target_png_dir])
end
+
+ ### Link to assets (for mnit and others)
+ # This will be accessed from `android_project_root`
+ var mainmodule_dir = compiler.mainmodule.location.file.filename.dirname
+ var assets_dir = "{mainmodule_dir}/../assets"
+ if not assets_dir.file_exists then assets_dir = "{mainmodule_dir}/assets"
+ if assets_dir.file_exists then
+ assets_dir = assets_dir.realpath
+ var target_assets_dir = "{android_project_root}/assets"
+ if not target_assets_dir.file_exists then
+ toolcontext.exec_and_check(["ln", "-s", assets_dir, target_assets_dir])
+ end
+ end
end
redef fun write_makefile(compiler, compile_dir, cfiles)
@@ -206,5 +226,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