if f isa ExternCFile then cfiles.add(f.filename.basename(""))
end
+ # Is there an icon?
+ var resolutions = ["ldpi", "mdpi", "hdpi", "xhdpi", "xxhdpi", "xxxhdpi"]
+ var icon_available = false
+ for res in resolutions do
+ var path = "res/drawable-{res}/icon.png"
+ if path.file_exists then
+ icon_available = true
+ break
+ end
+ end
+
+ var icon_declaration
+ if icon_available then
+ icon_declaration = "android:icon=\"@drawable/icon\""
+ else icon_declaration = ""
+
## Generate delagating makefile
dir = "{android_project_root}/jni/"
"""
android:versionName="{{{app_version}}}">
<!-- This is the platform API where NativeActivity was introduced. -->
- <uses-sdk
- android:minSdkVersion="{{{app_min_api}}}"
- android:targetSdkVersion="{{{app_target_api}}}"
- {{{app_max_api}}} />
+ <uses-sdk
+ android:minSdkVersion="{{{app_min_api}}}"
+ android:targetSdkVersion="{{{app_target_api}}}"
+ {{{app_max_api}}} />
<application
android:label="@string/app_name"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:configChanges="orientation|keyboardHidden"
- android:screenOrientation="portrait">
+ android:screenOrientation="portrait"
+ {{{icon_declaration}}}>
<!-- Tell NativeActivity the name of or .so -->
<meta-data android:name=\"{{{app_package}}}\"
android:value=\"{{{app_name}}}\" />
{{{project.manifest_lines.join("\n")}}}
-</manifest>
+</manifest>
<!-- END_INCLUDE(manifest) -->
""".write_to_file("{dir}/AndroidManifest.xml")
toolcontext.exec_and_check(["ln", "-s", assets_dir, target_assets_dir], "Android project error")
end
end
-
+
### copy resources (for android)
# This will be accessed from `android_project_root`
var res_dir