Merge: nitg: Added PNaCl support for Nit
authorJean Privat <jean@pryen.org>
Thu, 22 May 2014 23:28:01 +0000 (19:28 -0400)
committerJean Privat <jean@pryen.org>
Thu, 22 May 2014 23:28:01 +0000 (19:28 -0400)
Added pnacl_platform.nit in order to generate all minimum files when compiling the nit.
Added pnacl.nit, it's the module providing the tools for PNaCl support in Nit.

Modified nitg.nit to register the pnacl_platform.
Modified abstract_compiler.nit for a specific main generation and to add an option.

Signed-off-by: Djomanix <johan.kayser@viacesi.fr>

Pull-Request: #416
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>

1  2 
src/abstract_compiler.nit
src/android_platform.nit
src/toolcontext.nit
tests/nitg-e.skip
tests/nitg-g.skip
tests/nitg-s.skip

Simple merge
@@@ -240,29 -204,16 +209,29 @@@ $(call import-module,android/native_app
  
        redef fun compile_c_code(compiler, compile_dir)
        do
 +              var android_project_root = android_project_root.as(not null)
 +              var release = toolcontext.opt_release.value
 +
                # Compile C code (and thus Nit)
-               toolcontext.exec_and_check(["ndk-build", "-s", "-j", "4", "-C", android_project_root])
+               toolcontext.exec_and_check(["ndk-build", "-s", "-j", "4", "-C", android_project_root], "Android project error")
  
                # Generate the apk
 -              toolcontext.exec_and_check(["ant", "-q", "debug", "-f", android_project_root+"/build.xml"], "Android project error")
 +              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)
++              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"
 -              toolcontext.exec_and_check(["mv", "{android_project_root}/bin/{compiler.mainmodule.name}-debug.apk", outname], "Android project error")
 +
 +              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])
++              toolcontext.exec_and_check(["mv", "{android_project_root}/bin/{compiler.mainmodule.name}-{src_apk_suffix}.apk", outname], "Android project error")
        end
  end
  
Simple merge
@@@ -2,3 -2,6 +2,5 @@@ init_inheri
  init_linext
  inline
  test_json
 -pep8analysis_args
+ converter
+ pnacl
@@@ -2,4 -2,6 +2,5 @@@ init_inheri
  init_linext
  inline
  nitg
 -test_json
  mnit
+ pnacl
@@@ -2,3 -2,6 +2,5 @@@ init_inheri
  init_linext
  inline
  test_json
 -pep8analysis_args
+ converter
+ pnacl