+</resources>
+ """.write_to_file("{dir}/strings.xml")
+
+ ### Link to png sources
+ # libpng is not available on Android NDK
+ # FIXME make obtionnal when we have alternatives to mnit
+ var nit_dir = toolcontext.nit_dir
+ var share_dir = "{nit_dir}/share/"
+ if nit_dir == null or not share_dir.file_exists then
+ print "Android project error: Nit share directory not found, please use the environment variable NIT_DIR"
+ exit 1
+ end
+ share_dir = share_dir.realpath
+ var target_png_dir = "{android_project_root}/jni/png"
+ if not target_png_dir.file_exists then
+ toolcontext.exec_and_check(["ln", "-s", "{share_dir}/png/", target_png_dir], "Android project error")
+ end
+
+ ### Link to assets (for mnit and others)
+ # This will be accessed from `android_project_root`
+ var assets_dir
+ if compiler.mainmodule.location.file != null then
+ # it is a real file, use "{file}/../assets"
+ assets_dir = "{compiler.mainmodule.location.file.filename.dirname}/../assets"
+ else
+ # probably used -m, use "."
+ assets_dir = "assets"
+ end
+ 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], "Android project error")
+ end
+ end