aboutsummaryrefslogtreecommitdiff
path: root/po/ms
diff options
context:
space:
mode:
authorJuozas <juozaspo@gmail.com>2020-04-29 13:49:55 +0300
committerGitHub <noreply@github.com>2020-04-29 12:49:55 +0200
commit3f275d799cdcd61928854bb98ca5eb74af22f31e (patch)
tree61b0b6e08533472b934b65fcc42f2e1179944c8f /po/ms
parent00323e8fce28cb0620a20b7985c892101396c99e (diff)
downloadminetest-3f275d799cdcd61928854bb98ca5eb74af22f31e.tar.gz
minetest-3f275d799cdcd61928854bb98ca5eb74af22f31e.tar.bz2
minetest-3f275d799cdcd61928854bb98ca5eb74af22f31e.zip
Fix gettext detection and locale building (#9772)
broken since a368e7e
Diffstat (limited to 'po/ms')
0 files changed, 0 insertions, 0 deletions
href='#n113'>113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137
#!/bin/bash -e

prompt_for_number() {
	local prompt_text=$1
	local default_value=$2
	local tmp=""
	while true; do
		read -p "$prompt_text [$default_value]: " tmp
		if [ "$tmp" = "" ]; then
			echo "$default_value"; return
		elif echo "$tmp" | grep -q -E '^[0-9]+$'; then
			echo "$tmp"; return
		fi
	done
}

# On a release the following actions are performed
# * DEVELOPMENT_BUILD is set to false
# * android versionCode is bumped
# * appdata release version and date are updated
# * Commit the changes
# * Tag with current version
perform_release() {
	sed -i -re "s/^set\(DEVELOPMENT_BUILD TRUE\)$/set(DEVELOPMENT_BUILD FALSE)/" CMakeLists.txt

	sed -i -re "s/versionCode [0-9]+$/versionCode $NEW_ANDROID_VERSION_CODE/" build/android/build.gradle

	sed -i '/\<release/s/\(version\)="[^"]*"/\1="'"$RELEASE_VERSION"'"/' misc/net.minetest.minetest.appdata.xml

	RELEASE_DATE=`date +%Y-%m-%d`

	sed -i 's/\(<release date\)="[^"]*"/\1="'"$RELEASE_DATE"'"/' misc/net.minetest.minetest.appdata.xml

	git add -f CMakeLists.txt build/android/build.gradle misc/net.minetest.minetest.appdata.xml

	git commit -m "Bump version to $RELEASE_VERSION"

	echo "Tagging $RELEASE_VERSION"

	git tag -a "$RELEASE_VERSION" -m "$RELEASE_VERSION"
}

# After release
# * Set DEVELOPMENT_BUILD to true
# * Bump version in CMakeLists and docs
# * Commit the changes
back_to_devel() {
	echo 'Creating "return back to development" commit'

	sed -i -re 's/^set\(DEVELOPMENT_BUILD FALSE\)$/set(DEVELOPMENT_BUILD TRUE)/' CMakeLists.txt

	sed -i -re "s/^set\(VERSION_MAJOR [0-9]+\)$/set(VERSION_MAJOR $NEXT_VERSION_MAJOR)/" CMakeLists.txt

	sed -i -re "s/^set\(VERSION_MINOR [0-9]+\)$/set(VERSION_MINOR $NEXT_VERSION_MINOR)/" CMakeLists.txt

	sed -i -re "s/^set\(VERSION_PATCH [0-9]+\)$/set(VERSION_PATCH $NEXT_VERSION_PATCH)/" CMakeLists.txt

	sed -i -re "1s/[0-9]+\.[0-9]+\.[0-9]+/$NEXT_VERSION/g" doc/menu_lua_api.txt

	sed -i -re "1s/[0-9]+\.[0-9]+\.[0-9]+/$NEXT_VERSION/g" doc/client_lua_api.txt

	git add -f CMakeLists.txt doc/menu_lua_api.txt doc/client_lua_api.txt

	git commit -m "Continue with $NEXT_VERSION-dev"
}
##################################
# Switch to top minetest directory
##################################

cd ${0%/*}/..


#######################
# Determine old version
#######################

# Make sure all the files we need exist
grep -q -E '^set\(VERSION_MAJOR [0-9]+\)$' CMakeLists.txt
grep -q -E '^set\(VERSION_MINOR [0-9]+\)$' CMakeLists.txt
grep -q -E '^set\(VERSION_PATCH [0-9]+\)$' CMakeLists.txt
grep -q -E 'versionCode [0-9]+$' build/android/build.gradle

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 'versionCode [0-9]+$' build/android/build.gradle | tr -dC 0-9)

RELEASE_VERSION="$VERSION_MAJOR.$VERSION_MINOR.$VERSION_PATCH"

echo "Current Minetest version: $RELEASE_VERSION"
echo "Current Android version code: $ANDROID_VERSION_CODE"

NEW_ANDROID_VERSION_CODE=$(expr $ANDROID_VERSION_CODE + 1)
NEW_ANDROID_VERSION_CODE=$(prompt_for_number "Set android version code" $NEW_ANDROID_VERSION_CODE)

echo
echo "New android version code: $NEW_ANDROID_VERSION_CODE"

########################
# Perform release
########################

perform_release

########################