summaryrefslogtreecommitdiff
path: root/util/bump_version.sh
diff options
context:
space:
mode:
authorShadowNinja <shadowninja@minetest.net>2016-04-13 14:14:04 -0400
committerShadowNinja <shadowninja@minetest.net>2016-04-28 12:28:42 -0400
commite41673820ffe200df78b1ec185ccb9d9ca962ae1 (patch)
tree94c0fda8c113920eb07bc97d03c7c551f8b6146f /util/bump_version.sh
parent7baddd173591cc9394d57cdb265f978495314f7a (diff)
downloadminetest-e41673820ffe200df78b1ec185ccb9d9ca962ae1.tar.gz
minetest-e41673820ffe200df78b1ec185ccb9d9ca962ae1.tar.bz2
minetest-e41673820ffe200df78b1ec185ccb9d9ca962ae1.zip
Upgrade Android build to Gradle build system
The old Ant build system has been deprecated for a while and new development is focused on Gradle. I also removed a hardcoded string that lint caught and moved the patch files to a subdirectory. I left the JNI files in the root directory.
Diffstat (limited to 'util/bump_version.sh')
-rwxr-xr-xutil/bump_version.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/util/bump_version.sh b/util/bump_version.sh
index 5ff69c8af..948561ac3 100755
--- a/util/bump_version.sh
+++ b/util/bump_version.sh
@@ -32,12 +32,12 @@ cd ${0%/*}/..
grep -q -E '^set\(VERSION_MAJOR [0-9]+\)$' CMakeLists.txt || die "error: Could not find CMakeLists.txt"
grep -q -E '^set\(VERSION_MINOR [0-9]+\)$' CMakeLists.txt || die "error: Could not find CMakeLists.txt"
grep -q -E '^set\(VERSION_PATCH [0-9]+\)$' CMakeLists.txt || die "error: Could not find CMakeLists.txt"
-grep -q -E '^ANDROID_VERSION_CODE = [0-9]+$' build/android/Makefile || die "error: Could not find build/android/Makefile"
+grep -q -E 'versionCode [0-9]+$' build/android/build.gradle || die "error: Could not find Android version code"
VERSION_MAJOR=$(grep -E '^set\(VERSION_MAJOR [0-9]+\)$' CMakeLists.txt | tr -dC 0-9)
VERSION_MINOR=$(grep -E '^set\(VERSION_MINOR [0-9]+\)$' CMakeLists.txt | tr -dC 0-9)
VERSION_PATCH=$(grep -E '^set\(VERSION_PATCH [0-9]+\)$' CMakeLists.txt | tr -dC 0-9)
-ANDROID_VERSION_CODE=$(grep -E '^ANDROID_VERSION_CODE = [0-9]+$' build/android/Makefile | tr -dC 0-9)
+ANDROID_VERSION_CODE=$(grep -E 'versionCode [0-9]+$' build/android/build.gradle | tr -dC 0-9)
echo "Current Minetest version: $VERSION_MAJOR.$VERSION_MINOR.$VERSION_PATCH"
echo "Current Android version code: $ANDROID_VERSION_CODE"
@@ -89,13 +89,13 @@ sed -i -re "s/^set\(VERSION_PATCH [0-9]+\)$/set(VERSION_PATCH $NEW_VERSION_PATCH
sed -i -re "s/^set\(DEVELOPMENT_BUILD TRUE\)$/set(DEVELOPMENT_BUILD FALSE)/" CMakeLists.txt || die "Failed to unset DEVELOPMENT_BUILD"
-sed -i -re "s/^ANDROID_VERSION_CODE = [0-9]+$/ANDROID_VERSION_CODE = $NEW_ANDROID_VERSION_CODE/" build/android/Makefile || die "Failed to update ANDROID_VERSION_CODE"
+sed -i -re "s/versionCode [0-9]+$/versionCode $NEW_ANDROID_VERSION_CODE/" build/android/build.gradle || die "Failed to update Android version code"
sed -i -re "1s/[0-9]+\.[0-9]+\.[0-9]+/$NEW_VERSION/g" doc/lua_api.txt || die "Failed to update doc/lua_api.txt"
sed -i -re "1s/[0-9]+\.[0-9]+\.[0-9]+/$NEW_VERSION/g" doc/menu_lua_api.txt || die "Failed to update doc/menu_lua_api.txt"
-git add -f CMakeLists.txt build/android/Makefile doc/lua_api.txt doc/menu_lua_api.txt || die "git add failed"
+git add -f CMakeLists.txt build/android/build.gradle doc/lua_api.txt doc/menu_lua_api.txt || die "git add failed"
git commit -m "Bump version to $NEW_VERSION" || die "git commit failed"