[Scummvm-git-logs] scummvm master -> 470a1d3586822d0d55e5abfc21de4da0e42a6555

sev- sev at scummvm.org
Fri Mar 27 21:45:29 UTC 2020


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
470a1d3586 ANDROID: Switch to Gradle


Commit: 470a1d3586822d0d55e5abfc21de4da0e42a6555
    https://github.com/scummvm/scummvm/commit/470a1d3586822d0d55e5abfc21de4da0e42a6555
Author: Peter Kohaut (peter.kohaut at gmail.com)
Date: 2020-03-27T22:45:25+01:00

Commit Message:
ANDROID: Switch to Gradle

Updated NDK to r21 (LTS)
Switch target Android to 29 as it is required by Google Play Store
Switch minimum Android to 16 (4.1) as it is the lowest supported version by NDK
Removed MIPS and armeabi as they are no longer supported
Renamed Android build names into official ones

Changed paths:
  A dists/android/build.gradle
  A dists/android/gradle/wrapper/gradle-wrapper.jar
  A dists/android/gradle/wrapper/gradle-wrapper.properties
  A dists/android/gradlew
  R dists/android/AndroidManifest.xml.in
  R dists/android/custom_rules.xml
  R dists/android/project.properties
    .gitignore
    backends/platform/android/android.mk
    configure
    dists/android/AndroidManifest.xml
    dists/android/README.Android


diff --git a/.gitignore b/.gitignore
index 4cd682ae83..31c27c04f9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,6 +10,7 @@ lib*.a
 
 /config.log
 /scummvm
+/libscummvm.so
 /scummvm-static
 /ScummVMDockTilePlugin*
 /config.h
@@ -37,6 +38,7 @@ lib*.a
 /Icon.*
 /scummvm-conf.cpp
 /tmp_*.cpp
+/*.apk
 
 /README
 /README.html
@@ -45,7 +47,7 @@ lib*.a
 /doc/de/NEUES
 /doc/de/NEUES.html
 
-/build
+/build*
 /staging
 /portdist
 
@@ -248,3 +250,13 @@ scummvm_switch.zip
 #Ignore gmon.out created by gprof
 gmon.out
 /scummvm_libs_2015
+
+#Ignore Eclipse related files (such as a Java plugin for Visual Studio Code)
+.settings
+.project
+
+#Ignore Android Studio files
+.idea
+
+#Ingore temporary Android project folder
+android_project
\ No newline at end of file
diff --git a/backends/platform/android/android.mk b/backends/platform/android/android.mk
index a03b4cff59..cbe96f4852 100644
--- a/backends/platform/android/android.mk
+++ b/backends/platform/android/android.mk
@@ -1,116 +1,63 @@
 # Android specific build targets
 
-# These must be incremented for each market upload
-ANDROID_VERSIONCODE = 45
-
-# Historical version codes:
-# ScummVM 2.1.1: 40-44 (armeabi, arm-v7a, arm64-v8a, x86, x86_64 respectively)
-# ScummVM 2.1.0: 35-39 (armeabi, arm-v7a, arm64-v8a, x86, x86_64 respectively)
-# ScummVM 2.0.0: 30-34
-# ScummVM 1.9.0.1: 25-28
-# ScummVM 1.9.0: 19
-# ScummVM 1.8.1: 15
-
-ANDROID_TARGET_VERSION = 28
-
-# ndk-build will build the ScummVM library in release mode by default unless:
-# - an Application.mk is provided in the jni folder with APP_OPTIM := debug
-# - or AndroidManifest.xml declares android:debuggable within its <application> tag
-NDK_BUILD = $(ANDROID_NDK)/ndk-build APP_ABI=$(ABI)
-SDK_ANDROID = $(ANDROID_SDK)/tools/android
-
 PATH_DIST = $(srcdir)/dists/android
-PATH_RESOURCES = $(PATH_DIST)/res
 
 PORT_DISTFILES = $(PATH_DIST)/README.Android
-DIST_JAVA_SRC_DIR = $(srcdir)/backends/platform/android/org
-
-RESOURCES = \
-	$(PATH_BUILD_RES)/values/strings.xml \
-	$(PATH_BUILD_RES)/values-television/margins.xml \
-	$(PATH_BUILD_RES)/layout/main.xml \
-	$(PATH_BUILD_RES)/drawable/scummvm.png \
-	$(PATH_BUILD_RES)/drawable/scummvm_big.png \
-	$(PATH_BUILD_RES)/drawable-xhdpi/leanback_icon.png \
-	$(PATH_BUILD_RES)/drawable-xhdpi/ouya_icon.png \
-	$(PATH_BUILD_RES)/drawable-hdpi/ic_action_keyboard.png \
-	$(PATH_BUILD_RES)/drawable-mdpi/ic_action_keyboard.png \
-	$(PATH_BUILD_RES)/drawable-xhdpi/ic_action_keyboard.png \
-	$(PATH_BUILD_RES)/drawable-xxhdpi/ic_action_keyboard.png
-
-DIST_ANDROID_MK = $(PATH_DIST)/jni/Android.mk
-DIST_BUILD_XML = $(PATH_DIST)/custom_rules.xml
-
-PATH_BUILD = ./build.tmp
+
+PATH_BUILD = ./android_project
+PATH_BUILD_GRADLE = $(PATH_BUILD)/build.gradle
 PATH_BUILD_ASSETS = $(PATH_BUILD)/assets
-PATH_BUILD_RES = $(PATH_BUILD)/res
 PATH_BUILD_LIBSCUMMVM = $(PATH_BUILD)/lib/$(ABI)/libscummvm.so
 
-FILE_MANIFEST_SRC = $(srcdir)/dists/android/AndroidManifest.xml
-FILE_MANIFEST = $(PATH_BUILD)/AndroidManifest.xml
-
 APK_MAIN = ScummVM-debug.apk
 APK_MAIN_RELEASE = ScummVM-release-unsigned.apk
 
-$(FILE_MANIFEST): $(FILE_MANIFEST_SRC) | $(PATH_BUILD)
-	@$(MKDIR) -p $(@D)
-	sed "s/@ANDROID_VERSIONCODE@/$(ANDROID_VERSIONCODE)/" < $< > $@
+$(PATH_BUILD):
+	$(MKDIR) $(PATH_BUILD)
 
-$(PATH_BUILD)/res/%: $(PATH_DIST)/res/% | $(PATH_BUILD)
-	@$(MKDIR) -p $(@D)
-	$(CP) $< $@
+$(PATH_BUILD_GRADLE): $(PATH_BUILD)
+	$(CP) -r $(PATH_DIST)/gradle/ $(PATH_BUILD)
+	$(INSTALL) -c -m 755 $(PATH_DIST)/gradlew $(PATH_BUILD)
+	$(INSTALL) -c -m 644 $(PATH_DIST)/build.gradle $(PATH_BUILD)
+	$(ECHO) "srcdir=$(realpath $(srcdir))" > $(PATH_BUILD)/gradle.properties
+	$(ECHO) "sdk.dir=$(realpath $(ANDROID_SDK_ROOT))\n" > $(PATH_BUILD)/local.properties
+	$(ECHO) "ndk.dir=$(realpath $(ANDROID_NDK_ROOT))\n" >> $(PATH_BUILD)/local.properties
 
-$(PATH_BUILD)/libs/%: $(PATH_DIST)/libs/% | $(PATH_BUILD)
-	@$(MKDIR) -p $(@D)
-	$(CP) $< $@
-
-$(PATH_BUILD_ASSETS): $(DIST_FILES_THEMES) $(DIST_FILES_ENGINEDATA) $(DIST_FILES_NETWORKING) $(DIST_FILES_VKEYBD) $(DIST_BUILD_XML) $(DIST_FILES_DOCS) $(PORT_DISTFILES) | $(PATH_BUILD)
+$(PATH_BUILD_ASSETS): $(DIST_FILES_THEMES) $(DIST_FILES_ENGINEDATA) $(DIST_FILES_NETWORKING) $(DIST_FILES_VKEYBD) $(DIST_FILES_DOCS) $(PORT_DISTFILES) | $(PATH_BUILD)
 	$(INSTALL) -d $(PATH_BUILD_ASSETS)
 	$(INSTALL) -c -m 644 $(DIST_FILES_THEMES) $(DIST_FILES_ENGINEDATA) $(DIST_FILES_NETWORKING) $(DIST_FILES_VKEYBD) $(DIST_FILES_DOCS) $(PORT_DISTFILES) $(PATH_BUILD_ASSETS)/
-	$(INSTALL) -d $(PATH_BUILD)/jni
-	$(INSTALL) -c -m 644 $(DIST_ANDROID_MK) $(PATH_BUILD)/jni
-	$(INSTALL) -c -m 644 $(DIST_BUILD_XML) $(PATH_BUILD)
-
-$(PATH_BUILD): $(DIST_ANDROID_MK)
-	$(MKDIR) -p $(PATH_BUILD) $(PATH_BUILD)/res
-	$(MKDIR) -p $(PATH_BUILD)/libs
 
 $(PATH_BUILD_LIBSCUMMVM): libscummvm.so | $(PATH_BUILD)
-	$(INSTALL) -c -m 644 libscummvm.so $(PATH_BUILD)
-	$(STRIP) $(PATH_BUILD)/libscummvm.so
-	cd $(PATH_BUILD); $(NDK_BUILD)
-
-$(PATH_BUILD_RES): $(RESOURCES) | $(PATH_BUILD)
+	$(INSTALL) -D -c -m 644 libscummvm.so $(PATH_BUILD_LIBSCUMMVM)
 
-setupapk: $(FILE_MANIFEST) $(PATH_BUILD_RES) $(PATH_BUILD_ASSETS) $(PATH_BUILD_LIBSCUMMVM) | $(PATH_BUILD)
-	$(SDK_ANDROID) update project -p $(PATH_BUILD) -t android-$(ANDROID_TARGET_VERSION) -n ScummVM
+$(APK_MAIN): $(PATH_BUILD_GRADLE) $(PATH_BUILD_ASSETS) $(PATH_BUILD_LIBSCUMMVM) | $(PATH_BUILD)
+	(cd $(PATH_BUILD); ./gradlew assembleDebug)
+	$(CP) $(PATH_BUILD)/build/outputs/apk/debug/ScummVM-debug.apk $@
 
-$(APK_MAIN): setupapk | $(PATH_BUILD)
-	(cd $(PATH_BUILD); ant debug -Dsource.dir="$(realpath $(DIST_JAVA_SRC_DIR))")
-	$(CP) $(PATH_BUILD)/bin/ScummVM-debug.apk $@
-
-$(APK_MAIN_RELEASE): setupapk | $(PATH_BUILD)
-	(cd $(PATH_BUILD); ant release -Dsource.dir="$(realpath $(DIST_JAVA_SRC_DIR))")
-	$(CP) $(PATH_BUILD)/bin/ScummVM-release-unsigned.apk $@
+$(APK_MAIN_RELEASE): $(PATH_BUILD_GRADLE) $(PATH_BUILD_ASSETS) $(PATH_BUILD_LIBSCUMMVM) | $(PATH_BUILD)
+	(cd $(PATH_BUILD); ./gradlew build)
+	$(CP) $(PATH_BUILD)/build/outputs/apk/release/ScummVM-release-unsigned.apk $@
 
 all: $(APK_MAIN)
 
 clean: androidclean
 
 androidclean:
-	@$(RM) -rf $(PATH_BUILD) *.apk release debug
+	@$(RM) -rf $(PATH_BUILD) *.apk
 
 androidrelease: $(APK_MAIN_RELEASE)
 
 androidtestmain: $(APK_MAIN)
-	$(ADB) install -r $(APK_MAIN)
-	$(ADB) shell am start -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -n org.scummvm.scummvm/.ScummVMActivity
+	(cd $(PATH_BUILD); ./gradlew installDebug)
+	# $(ADB) install -g -r $(APK_MAIN)
+	# $(ADB) shell am start -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -n org.scummvm.scummvm/.ScummVMActivity
 
 androidtest: $(APK_MAIN)
-	@set -e; for apk in $^; do \
-		$(ADB) install -r $$apk; \
-	done
-	$(ADB) shell am start -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -n org.scummvm.scummvm/.ScummVMActivity
+	# @set -e; for apk in $^; do \
+	# 	$(ADB) install -g -r $$apk; \
+	# done
+	# $(ADB) shell am start -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -n org.scummvm.scummvm/.ScummVMActivity
+	(cd $(PATH_BUILD); ./gradlew installDebug)
 
 # used by buildbot!
 androiddistdebug: all
@@ -127,4 +74,4 @@ androiddistrelease: androidrelease
 		sed 's/$$/\r/' < $$i > release/`basename $$i`.txt; \
 	done
 
-.PHONY: androidrelease androidtest $(PATH_BUILD_SRC)
+.PHONY: androidrelease androidtest $(PATH_BUILD_SRC)
\ No newline at end of file
diff --git a/configure b/configure
index 9bf7c35c6e..1e6f2abf88 100755
--- a/configure
+++ b/configure
@@ -969,13 +969,10 @@ Fine tuning of the installation directories:
 Special configuration feature:
   --host=HOST             cross-compile to target HOST (arm-linux, ...)
                           special targets: 3ds for Nintendo 3DS
-                                           android or android-arm for Android ARMv5TE (armeabi)
-                                           android-v7a or android-arm-v7a for Android ARMv7-A (armeabi-v7a)
+                                           android-arm-v7a for Android ARMv7-A (armeabi-v7a)
                                            android-arm64-v8a for Android ARMv8-A (arm64-v8a)
                                            android-x86 for Android x86
                                            android-x86_64 for Android x86_64
-                                           android-mips for Android MIPS
-                                           android-mips64 for Android MIPS64
                                            androidsdl for Android with SDL backend
                                            caanoo for Caanoo
                                            dingux for Dingux
@@ -1568,7 +1565,7 @@ case $_host in
 	datadir='${datarootdir}'
 	docdir='${prefix}/doc'
 	;;
-android | android-arm | android-v7a | android-arm-v7a | ouya)
+android-arm-v7a | ouya)
 	_host_os=android
 	_host_cpu=arm
 	_host_alias=arm-linux-androideabi
@@ -1578,16 +1575,6 @@ android-arm64-v8a)
 	_host_cpu=aarch64
 	_host_alias=aarch64-linux-android
 	;;
-android-mips)
-	_host_os=android
-	_host_cpu=mipsel
-	_host_alias=mipsel-linux-android
-	;;
-android-mips64)
-	_host_os=android
-	_host_cpu=mips64el
-	_host_alias=mips64el-linux-android
-	;;
 android-x86)
 	_host_os=android
 	_host_cpu=i686
@@ -1868,19 +1855,14 @@ esac
 #
 case $_host_os in
 android)
-	if test -z "$ANDROID_SDK"; then
-		# $ANDROID_SDK must be the path to the root of the Android SDK folder;
-		# The SDK should have installed the target SDK platform version as specified
-		# in the Android port's manifest files and project.properties
-		echo "Please set ANDROID_SDK in your environment. Export ANDROID_SDK=<path to Android SDK>"
-		exit 1
-	fi
-	if test -z "$ANDROID_NDK"; then
-		# $ANDROID_NDK must be the path to the root of the NDK folder;
-		# A ndk-build script should reside (in r14b this calls the actual ndk-build in the build subfolder)
-		echo "Please set ANDROID_NDK in your environment. Export ANDROID_NDK=<path to Android NDK>"
-		exit 1
+	if test -z "$ANDROID_SDK_ROOT"; then
+		echo "Please set ANDROID_SDK_ROOT in your environment. export ANDROID_SDK_ROOT=<path to Android SDK>"
+ 		exit 1
 	fi
+	if test -z "$ANDROID_NDK_ROOT"; then
+		echo "Please set ANDROID_NDK_ROOT in your environment. export ANDROID_NDK_ROOT=<path to Android NDK>"
+ 		exit 1
+ 	fi
 	;;
 3ds | ds | gamecube | switch | wii)
 	if test -z "$DEVKITPRO"; then
@@ -1981,6 +1963,36 @@ webos)
 	;;
 esac
 
+
+# Toolchain for Android is in NDK and is using different naming convention
+if test "$_host_os" = android; then
+	case $_host_cpu in
+	arm)
+		_android_target="armv7a-linux-androideabi16"
+		;;
+	aarch64)
+		# Platform version 21 is needed as earlier versions of platform do not support this architecture.
+		_android_target="aarch64-linux-android21"
+		;;
+	i686)
+		_android_target="i686-linux-android16"
+		;;
+	x86_64)
+		# Platform version 21 is needed as earlier versions of platform do not support this architecture.
+		_android_target="x86_64-linux-android21"
+		;;
+	esac
+
+	CXX="$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++"
+	append_var CXXFLAGS "-target $_android_target"
+	append_var LDFLAGS "-target $_android_target"
+
+	_ar="$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/$_ar"
+	_as="$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/$_as"
+	_ranlib="$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/$_ranlib"
+	_strip="$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/$_strip"
+fi
+
 #
 # Determine the C++ compiler
 #
@@ -2508,12 +2520,12 @@ define_in_config_h_if_yes $_need_memalign 'SCUMM_NEED_ALIGNMENT'
 echo_n "Checking host CPU architecture... "
 case $_host_cpu in
 	arm*)
-		echo "ARM"
+		echo "arm"
 		case $_host in
 			openpandora)
 				define_in_config_if_yes yes 'USE_ARM_NEON_ASPECT_CORRECTOR'
 				;;
-			android | android-arm | androidsdl-armeabi | arm-*riscos | caanoo | ds | gp2x | gp2xwiz | maemo | tizen)
+			androidsdl-armeabi | arm-*riscos | caanoo | ds | gp2x | gp2xwiz | maemo | tizen)
 				define_in_config_if_yes yes 'USE_ARM_SCALER_ASM'
 				# FIXME: The following feature exhibits a bug. It produces distorted
 				# sound since 9003ce517ff9906b0288f9f7c02197fd091d4554. The ARM
@@ -2531,6 +2543,9 @@ case $_host_cpu in
 
 		append_var DEFINES "-DARM_TARGET"
 		;;
+	aarch64)
+		echo "aarch64"
+		;;
 	i[3-6]86)
 		echo "x86"
 		_have_x86=yes
@@ -2590,65 +2605,49 @@ case $_host_os in
 		;;
 	android)
 		case $_host in
-			android | android-arm)
-				append_var CXXFLAGS "-march=armv5te"
-				append_var CXXFLAGS "-mtune=xscale"
-				append_var CXXFLAGS "-mfloat-abi=softfp"
-				ABI="armeabi"
-				;;
-			android-v7a | android-arm-v7a)
-				append_var CXXFLAGS "-march=armv7-a"
-				append_var CXXFLAGS "-mfloat-abi=softfp"
+			android-arm-v7a)
+				# Disable NEON for older devices (like with Tegra 2)
 				append_var CXXFLAGS "-mfpu=vfp"
-				append_var LDFLAGS "-march=armv7-a"
+				# This is really old CPU but might be still used with android 4.1, it slightly increases code size and decreases performance.
 				append_var LDFLAGS "-Wl,--fix-cortex-a8"
 				ABI="armeabi-v7a"
 				;;
 			android-arm64-v8a)
 				ABI="arm64-v8a"
 				;;
-			android-mips)
-				append_var CXXFLAGS "-march=mips32"
-				append_var CXXFLAGS "-mtune=mips32"
-				ABI="mips"
-				# Platform version 9 is needed as earlier versions of platform do not support this arch.
-				;;
-			android-mips64)
-				ABI="mips64"
-				;;
 			android-x86)
-				append_var CXXFLAGS "-march=i686"
-				append_var CXXFLAGS "-mtune=intel"
 				ABI="x86"
-				# Platform version 9 is needed as earlier versions of platform do not support this arch.
 				;;
 			android-x86_64)
-				append_var CXXFLAGS "-march=x86-64"
-				append_var CXXFLAGS "-mtune=intel"
 				ABI="x86_64"
 				;;
 			ouya)
-				append_var CXXFLAGS "-march=armv7-a"
 				append_var CXXFLAGS "-mtune=cortex-a9"
-				append_var CXXFLAGS "-mfloat-abi=softfp"
-				append_var CXXFLAGS "-mfpu=neon"
 				ABI="armeabi-v7a"
 				;;
 		esac
 
+		append_var CXXFLAGS "-Wno-inconsistent-missing-override"
+
 		append_var CXXFLAGS "-fpic"
 		append_var CXXFLAGS "-ffunction-sections"
 		append_var CXXFLAGS "-funwind-tables"
-		if test "$_debug_build" = yes; then
-			append_var CXXFLAGS "-fno-omit-frame-pointer"
-			append_var CXXFLAGS "-fno-strict-aliasing"
-		else
+		if test "$_debug_build" = no; then
+			_optimization_level=-Os
 			append_var CXXFLAGS "-fomit-frame-pointer"
 			append_var CXXFLAGS "-fstrict-aliasing"
+		else
+			_optimization_level=-O0
+			append_var CXXFLAGS "-fno-omit-frame-pointer"
+			append_var CXXFLAGS "-fno-strict-aliasing"
 		fi
-		_optimization_level=-Os
 
-		add_line_to_config_mk "ANDROID_SDK = $ANDROID_SDK"
+		# Build ID is needed for native debugging in Android Studio
+		append_var LDFLAGS "-Wl,--build-id=sha1"
+
+		add_line_to_config_mk "ANDROID_SDK_ROOT := $ANDROID_SDK_ROOT"
+		add_line_to_config_mk "ANDROID_NDK_ROOT := $ANDROID_NDK_ROOT"
+
 		_seq_midi=no
 		;;
 	beos*)
@@ -3076,12 +3075,13 @@ if test -n "$_host"; then
 			_vorbis=no
 			_port_mk="backends/platform/3ds/3ds.mk"
 			;;
-		android | android-arm | android-v7a | android-arm-v7a | android-arm64-v8a | android-mips | android-mips64 | android-x86 | android-x86_64 | ouya)
+		android-arm-v7a | android-arm64-v8a | android-x86 | android-x86_64 | ouya)
 			# also __ANDROID__ is defined by Clang in the NDK
 			DEFINES="$DEFINES -D__ANDROID_PLAIN_PORT__ -DANDROID_PLAIN_PORT"
 			# we link a .so as default
 			append_var LDFLAGS "-shared"
 			append_var LDFLAGS "-Wl,-Bsymbolic,--no-undefined"
+			append_var LDFLAGS "-static-libstdc++"
 			HOSTEXEPRE=lib
 			HOSTEXEEXT=.so
 			_backend="android"
@@ -3525,7 +3525,7 @@ case $_backend in
 		append_var CXXFLAGS "-Wa,--noexecstack"
 		append_var LDFLAGS "-Wl,-z,noexecstack"
 		# removed the following directive - was causing compilation issues when not also explicitly using --disable-mt32emu
-#		append_var INCLUDES "-isystem $ANDROID_NDK/sources/cxx-stl/system/include"
+		# append_var INCLUDES "-isystem $ANDROID_NDK/sources/cxx-stl/system/include"
 		_sdl=no
 		if test "$_host" = ouya; then
 			_sdlnet=no
@@ -3711,6 +3711,8 @@ case $_backend in
 		exit 1
 		;;
 esac
+
+
 append_var MODULES "backends/platform/$_backend"
 
 #
diff --git a/dists/android/AndroidManifest.xml b/dists/android/AndroidManifest.xml
index 22443fa611..b04ea17052 100644
--- a/dists/android/AndroidManifest.xml
+++ b/dists/android/AndroidManifest.xml
@@ -3,16 +3,12 @@
 <!-- NB: android:versionCode needs to be bumped for formal releases -->
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
 		package="org.scummvm.scummvm"
-		android:versionCode="@ANDROID_VERSIONCODE@"
-		android:versionName="2.2.0git"
 		android:launchMode="singleTask"
 		android:installLocation="auto"
 		android:sharedUserId="org.scummvm.scummvm">
 
-	<uses-sdk android:minSdkVersion="3"
-			android:targetSdkVersion="28"/>
 
-	<uses-permission
+		<uses-permission
 			android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
 
 	<uses-permission
diff --git a/dists/android/AndroidManifest.xml.in b/dists/android/AndroidManifest.xml.in
deleted file mode 100644
index 3f8ccad934..0000000000
--- a/dists/android/AndroidManifest.xml.in
+++ /dev/null
@@ -1,73 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<!-- NB: android:versionCode needs to be bumped for formal releases -->
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-		package="org.scummvm.scummvm"
-		android:versionCode="@ANDROID_VERSIONCODE@"
-		android:versionName="@VERSION@"
-		android:launchMode="singleTask"
-		android:installLocation="auto"
-		android:sharedUserId="org.scummvm.scummvm">
-
-	<uses-sdk android:minSdkVersion="3"
-			android:targetSdkVersion="28"/>
-
-	<uses-permission
-			android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
-
-	<uses-permission
-			android:name="android.permission.READ_EXTERNAL_STORAGE"/>
-
-	<uses-permission
-			android:name="android.permission.ACCESS_WIFI_STATE"/>
-
-	<uses-permission
-			android:name="android.permission.INTERNET" />
-
-	<uses-permission
-			android:name="android.permission.ACCESS_NETWORK_STATE" />
-
-	<uses-feature
-			android:name="android.hardware.wifi"
-			android:required="false"/>
-
-	<uses-feature
-			android:name="android.hardware.screen.landscape"
-			android:required="false"/>
-
-	<uses-feature
-			android:name="android.hardware.touchscreen"
-			android:required="false"/>
-
-	<uses-feature
-			android:name="android.software.leanback"
-			android:required="false"/>
-
-	<supports-screens
-			android:smallScreens="true"
-			android:normalScreens="true"
-			android:largeScreens="true"
-			android:xlargeScreens="true" />
-
-	<application
-			android:label="@string/app_name"
-			android:description="@string/app_desc"
-			android:allowBackup="true"
-			android:isGame="true"
-			android:resizeableActivity="false"
-			android:icon="@drawable/scummvm">
-		<activity android:name=".ScummVMActivity"
-				android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
-				android:banner="@drawable/leanback_icon"
-				android:screenOrientation="landscape"
-				android:configChanges="orientation|keyboardHidden|screenSize"
-				android:windowSoftInputMode="adjustResize">
-			<intent-filter>
-				<action android:name="android.intent.action.MAIN"/>
-				<category android:name="android.intent.category.LAUNCHER"/>
-				<category android:name="tv.ouya.intent.category.GAME"/>
-				<category android:name="android.intent.category.LEANBACK_LAUNCHER"/>
-			</intent-filter>
-		</activity>
-	</application>
-</manifest>
diff --git a/dists/android/README.Android b/dists/android/README.Android
index ceb98f1746..31249ceaad 100644
--- a/dists/android/README.Android
+++ b/dists/android/README.Android
@@ -3,7 +3,7 @@ README for the Android port of ScummVM
 
 REQUIREMENTS
 
-  - Android 2.3 or later
+  - Android 4.1 or later
 
 INSTALL
 
diff --git a/dists/android/build.gradle b/dists/android/build.gradle
new file mode 100644
index 0000000000..2e0ef5e26a
--- /dev/null
+++ b/dists/android/build.gradle
@@ -0,0 +1,67 @@
+buildscript {
+    repositories {
+        google()
+        jcenter()
+    }
+    dependencies {
+        classpath 'com.android.tools.build:gradle:3.6.0'
+    }
+}
+
+dependencies {
+    repositories {
+        google()
+        jcenter()
+    }
+}
+
+// Enable to see use of depracted API
+// tasks.withType(JavaCompile) {
+//     options.compilerArgs << "-Xlint:deprecation"
+// }
+
+apply plugin: 'com.android.application'
+
+android {
+    compileSdkVersion 29
+    buildToolsVersion "29.0.3"
+    ndkVersion "21.0.6113669"
+
+    defaultConfig {
+        applicationId "org.scummvm.scummvm"
+
+        setProperty("archivesBaseName", "ScummVM")
+
+        minSdkVersion 16
+        targetSdkVersion 29
+
+        versionName "2.2.0git"
+        versionCode 45
+        // versioncode must be incremented for each market upload
+        // Historical version codes:
+        // ScummVM 2.1.1: 40-44 (armeabi, arm-v7a, arm64-v8a, x86, x86_64 respectively)
+        // ScummVM 2.1.0: 35-39 (armeabi, arm-v7a, arm64-v8a, x86, x86_64 respectively)
+        // ScummVM 2.0.0: 30-34
+        // ScummVM 1.9.0.1: 25-28
+        // ScummVM 1.9.0: 19
+        // ScummVM 1.8.1: 15
+
+    }
+    buildTypes {
+        release {
+            minifyEnabled false
+        }
+    }
+    sourceSets {
+        main {
+            assets.srcDirs 'assets/'
+            java.srcDirs srcdir + '/backends/platform/android/'
+            jniLibs.srcDirs 'lib/'
+            res.srcDirs srcdir + '/dists/android/res/'
+            manifest.srcFile srcdir + '/dists/android/AndroidManifest.xml'
+        }
+    }
+    lintOptions {
+        abortOnError false
+    }
+}
diff --git a/dists/android/custom_rules.xml b/dists/android/custom_rules.xml
deleted file mode 100644
index 5ed81b7273..0000000000
--- a/dists/android/custom_rules.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project name="custom_rules">
-    <!-- Override the built-in aapt task, don't compress assets. -->
-    <target name="-package-resources" depends="-crunch">
-        <!-- only package resources if *not* a library project -->
-        <do-only-if-not-library elseText="Library project: do not package resources..." >
-            <aapt executable="${aapt}"
-                    command="package"
-                    versioncode="${version.code}"
-                    versionname="${version.name}"
-                    debug="${build.is.packaging.debug}"
-                    manifest="${out.manifest.abs.file}"
-                    assets="${asset.absolute.dir}"
-                    androidjar="${project.target.android.jar}"
-                    apkfolder="${out.absolute.dir}"
-                    nocrunch="${build.packaging.nocrunch}"
-                    resourcefilename="${resource.package.file.name}"
-                    resourcefilter="${aapt.resource.filter}"
-                    libraryResFolderPathRefid="project.library.res.folder.path"
-                    libraryPackagesRefid="project.library.packages"
-                    libraryRFileRefid="project.library.bin.r.file.path"
-                    previousBuildType="${build.last.target}"
-                    buildType="${build.target}"
-                    ignoreAssets="${aapt.ignore.assets}">
-                <res path="${out.res.absolute.dir}" />
-                <res path="${resource.absolute.dir}" />
-                <nocompress /> <!-- forces no compression on any files in assets or res/raw -->
-            </aapt>
-        </do-only-if-not-library>
-    </target>
-</project>
diff --git a/dists/android/gradle/wrapper/gradle-wrapper.jar b/dists/android/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000000..f6b961fd5a
Binary files /dev/null and b/dists/android/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/dists/android/gradle/wrapper/gradle-wrapper.properties b/dists/android/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000000..674bdda00e
--- /dev/null
+++ b/dists/android/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,5 @@
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
diff --git a/dists/android/gradlew b/dists/android/gradlew
new file mode 100755
index 0000000000..cccdd3d517
--- /dev/null
+++ b/dists/android/gradlew
@@ -0,0 +1,172 @@
+#!/usr/bin/env sh
+
+##############################################################################
+##
+##  Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+    ls=`ls -ld "$PRG"`
+    link=`expr "$ls" : '.*-> \(.*\)$'`
+    if expr "$link" : '/.*' > /dev/null; then
+        PRG="$link"
+    else
+        PRG=`dirname "$PRG"`"/$link"
+    fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+    echo "$*"
+}
+
+die () {
+    echo
+    echo "$*"
+    echo
+    exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+  CYGWIN* )
+    cygwin=true
+    ;;
+  Darwin* )
+    darwin=true
+    ;;
+  MINGW* )
+    msys=true
+    ;;
+  NONSTOP* )
+    nonstop=true
+    ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+        # IBM's JDK on AIX uses strange locations for the executables
+        JAVACMD="$JAVA_HOME/jre/sh/java"
+    else
+        JAVACMD="$JAVA_HOME/bin/java"
+    fi
+    if [ ! -x "$JAVACMD" ] ; then
+        die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+    fi
+else
+    JAVACMD="java"
+    which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+    MAX_FD_LIMIT=`ulimit -H -n`
+    if [ $? -eq 0 ] ; then
+        if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+            MAX_FD="$MAX_FD_LIMIT"
+        fi
+        ulimit -n $MAX_FD
+        if [ $? -ne 0 ] ; then
+            warn "Could not set maximum file descriptor limit: $MAX_FD"
+        fi
+    else
+        warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+    fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+    GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+    APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+    CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+    JAVACMD=`cygpath --unix "$JAVACMD"`
+
+    # We build the pattern for arguments to be converted via cygpath
+    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+    SEP=""
+    for dir in $ROOTDIRSRAW ; do
+        ROOTDIRS="$ROOTDIRS$SEP$dir"
+        SEP="|"
+    done
+    OURCYGPATTERN="(^($ROOTDIRS))"
+    # Add a user-defined pattern to the cygpath arguments
+    if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+        OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+    fi
+    # Now convert the arguments - kludge to limit ourselves to /bin/sh
+    i=0
+    for arg in "$@" ; do
+        CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+        CHECK2=`echo "$arg"|egrep -c "^-"`                                 ### Determine if an option
+
+        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition
+            eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+        else
+            eval `echo args$i`="\"$arg\""
+        fi
+        i=$((i+1))
+    done
+    case $i in
+        (0) set -- ;;
+        (1) set -- "$args0" ;;
+        (2) set -- "$args0" "$args1" ;;
+        (3) set -- "$args0" "$args1" "$args2" ;;
+        (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+        (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+        (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+        (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+        (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+        (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+    esac
+fi
+
+# Escape application args
+save () {
+    for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+    echo " "
+}
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+  cd "$(dirname "$0")"
+fi
+
+exec "$JAVACMD" "$@"
diff --git a/dists/android/project.properties b/dists/android/project.properties
deleted file mode 100644
index 29e368b379..0000000000
--- a/dists/android/project.properties
+++ /dev/null
@@ -1,11 +0,0 @@
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must be checked in Version Control Systems.
-#
-# To customize properties used by the Ant build system use,
-# "ant.properties", and override values to adapt the script to your
-# project structure.
-
-# Project target.
-target=android-28




More information about the Scummvm-git-logs mailing list