nitc/android: temporally disable the GC on Android
[nit.git] / src / platform / android.nit
index 6627d3e..b192d91 100644 (file)
@@ -36,7 +36,7 @@ class AndroidPlatform
 
        redef fun name do return "android"
 
-       redef fun supports_libgc do return true
+       redef fun supports_libgc do return false
 
        redef fun supports_libunwind do return false
 
@@ -109,7 +109,7 @@ class AndroidToolchain
 
                # Gather extra C files generated elsewhere than in super
                for f in compiler.extern_bodies do
-                       if f isa ExternCFile then cfiles.add(f.filename.basename(""))
+                       if f isa ExternCFile then cfiles.add(f.filename.basename)
                end
 
                # Is there an icon?
@@ -134,7 +134,7 @@ class AndroidToolchain
                        var extra_java_files = mmodule.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(""))
+                               path.file_copy_to(dir/path.basename)
                        end
                end
 
@@ -260,13 +260,13 @@ $(call import-module,android/native_app_glue)
                # Copy assets, resources and libs where expected by the SDK
 
                var project_root = "."
-               var mproject = compiler.mainmodule.first_real_mmodule.mproject
-               if mproject != null then
-                       var root = mproject.root
+               var mpackage = compiler.mainmodule.first_real_mmodule.mpackage
+               if mpackage != null then
+                       var root = mpackage.root
                        if root != null then
                                var filepath = root.filepath
                                if filepath != null then
-                                       project_root = filepath / ".."
+                                       project_root = filepath
                                end
                        end
                end
@@ -337,11 +337,16 @@ $(call import-module,android/native_app_glue)
                        var tsa_server= "TSA_SERVER".environ
 
                        if key_alias.is_empty then
-                               toolcontext.error(null,
-                                       "Error: the environment variable `KEY_ALIAS` must be set to use the `--release` option on Android projects.")
+                               toolcontext.warning(null, "key-alias",
+                                       "Warning: the environment variable `KEY_ALIAS` is not set, the APK file will not be signed.")
+
+                               # Just move the unsigned APK to outname
+                               args = ["mv", apk_path, outname]
+                               toolcontext.exec_and_check(args, "Android project error")
                                return
                        end
 
+                       # We have a key_alias, try to sign the APK
                        args = ["jarsigner", "-sigalg", "MD5withRSA", "-digestalg", "SHA1", apk_path, key_alias]
 
                        ## Use a custom keystore