Revert version scheme changes
authorsfan5 <sfan5@live.de>
Mon, 20 Nov 2017 18:27:06 +0000 (19:27 +0100)
committersfan5 <sfan5@live.de>
Mon, 20 Nov 2017 18:28:58 +0000 (19:28 +0100)
This reverts commit 41b7823057bdaddd760f932dce802719301c3a0f.
This reverts commit 7968f1ddaa67432719d5becdda5ca8bec58faa47.

CMakeLists.txt
doc/client_lua_api.md
doc/lua_api.txt
doc/menu_lua_api.txt
util/bump_version.sh

index 9f0fda6145d0a395811ebd1d3a1ce9409fcc46ff..1a0dcb6886eb71131b31c3741adb80f6bfc56225 100644 (file)
@@ -13,11 +13,11 @@ set(PROJECT_NAME_CAPITALIZED "Minetest")
 # Also remember to set PROTOCOL_VERSION in network/networkprotocol.h when releasing
 set(VERSION_MAJOR 0)
 set(VERSION_MINOR 4)
-set(VERSION_PATCH 17)
+set(VERSION_PATCH 16)
 set(VERSION_EXTRA "" CACHE STRING "Stuff to append to version string")
 
 # Change to false for releases
-set(DEVELOPMENT_BUILD TRUE)
+set(DEVELOPMENT_BUILD FALSE)
 
 set(VERSION_STRING "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
 if(VERSION_EXTRA)
index 436f22b41159b94c91aac58ae030c11d6e42a3fe..b3e494cc13fbd89a57e4c7c60d928dc4e43a254d 100644 (file)
@@ -1,4 +1,4 @@
-Minetest Lua Client Modding API Reference 0.4.17
+Minetest Lua Client Modding API Reference 0.4.15
 ================================================
 * More information at <http://www.minetest.net/>
 * Developer Wiki: <http://dev.minetest.net/>
index 8c02ebb85c7c948cea5af92e629279be704af487..ae8263c6c3a4b6eed9560ce1c02ecd0458547ed4 100644 (file)
@@ -1,4 +1,4 @@
-Minetest Lua Modding API Reference 0.4.17
+Minetest Lua Modding API Reference 0.4.16
 =========================================
 * More information at <http://www.minetest.net/>
 * Developer Wiki: <http://dev.minetest.net/>
index eb0d2ed6c4a7905362541f75d34cd1180259affb..074bc962d4349144ecfea2766247bf90cbed0101 100644 (file)
@@ -1,4 +1,4 @@
-Minetest Lua Mainmenu API Reference 0.4.17
+Minetest Lua Mainmenu API Reference 0.4.16
 ========================================
 
 Introduction
index 35cad78a7b9539fa251211b9969419f54780de2f..948561ac325bd5be3a5803a3fb4442faacffbb22 100755 (executable)
@@ -1,4 +1,6 @@
-#!/bin/bash -e
+#!/bin/bash
+
+die() { echo "$@" 1>&2 ; exit 1; }
 
 prompt_for_number() {
        local prompt_text=$1
@@ -14,50 +16,7 @@ prompt_for_number() {
        done
 }
 
-# On a release the following actions are performed
-# * DEVELOPMENT_BUILD is set to false
-# * android versionCode is bumped
-# * 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
-
-       git add -f CMakeLists.txt build/android/build.gradle
-
-       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/lua_api.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.md
-
-       git add -f CMakeLists.txt doc/lua_api.txt doc/menu_lua_api.txt doc/client_lua_api.md
-
-       git commit -m "Continue with $NEXT_VERSION-dev"
-}
 ##################################
 # Switch to top minetest directory
 ##################################
@@ -70,64 +29,93 @@ cd ${0%/*}/..
 #######################
 
 # 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
+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 '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 '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 Minetest version: $VERSION_MAJOR.$VERSION_MINOR.$VERSION_PATCH"
 echo "Current Android version code: $ANDROID_VERSION_CODE"
 
+
+########################
+# Prompt for new version
+########################
+
+NEW_VERSION_MAJOR=$VERSION_MAJOR
+NEW_VERSION_MINOR=$VERSION_MINOR
+NEW_VERSION_PATCH=$(expr $VERSION_PATCH + 1)
+
+NEW_VERSION_MAJOR=$(prompt_for_number "Set major" $NEW_VERSION_MAJOR)
+
+if [ "$NEW_VERSION_MAJOR" != "$VERSION_MAJOR" ]; then
+       NEW_VERSION_MINOR=0
+       NEW_VERSION_PATCH=0
+fi
+
+NEW_VERSION_MINOR=$(prompt_for_number "Set minor" $NEW_VERSION_MINOR)
+
+if [ "$NEW_VERSION_MINOR" != "$VERSION_MINOR" ]; then
+       NEW_VERSION_PATCH=0
+fi
+
+NEW_VERSION_PATCH=$(prompt_for_number "Set patch" $NEW_VERSION_PATCH)
+
 NEW_ANDROID_VERSION_CODE=$(expr $ANDROID_VERSION_CODE + 1)
 NEW_ANDROID_VERSION_CODE=$(prompt_for_number "Set android version code" $NEW_ANDROID_VERSION_CODE)
 
+NEW_VERSION="$NEW_VERSION_MAJOR.$NEW_VERSION_MINOR.$NEW_VERSION_PATCH"
+
+
 echo
+echo "New version: $NEW_VERSION"
 echo "New android version code: $NEW_ANDROID_VERSION_CODE"
 
-########################
-# Perform release
-########################
 
-perform_release
+#######################################
+# Replace version everywhere and commit
+#######################################
 
-########################
-# Prompt for next version
-########################
+sed -i -re "s/^set\(VERSION_MAJOR [0-9]+\)$/set(VERSION_MAJOR $NEW_VERSION_MAJOR)/" CMakeLists.txt || die "Failed to update VERSION_MAJOR"
 
-NEXT_VERSION_MAJOR=$VERSION_MAJOR
-NEXT_VERSION_MINOR=$VERSION_MINOR
-NEXT_VERSION_PATCH=$(expr $VERSION_PATCH + 1)
+sed -i -re "s/^set\(VERSION_MINOR [0-9]+\)$/set(VERSION_MINOR $NEW_VERSION_MINOR)/" CMakeLists.txt || die "Failed to update VERSION_MINOR"
 
-NEXT_VERSION_MAJOR=$(prompt_for_number "Set next major" $NEXT_VERSION_MAJOR)
+sed -i -re "s/^set\(VERSION_PATCH [0-9]+\)$/set(VERSION_PATCH $NEW_VERSION_PATCH)/" CMakeLists.txt || die "Failed to update VERSION_PATCH"
 
-if [ "$NEXT_VERSION_MAJOR" != "$VERSION_MAJOR" ]; then
-       NEXT_VERSION_MINOR=0
-       NEXT_VERSION_PATCH=0
-fi
+sed -i -re "s/^set\(DEVELOPMENT_BUILD TRUE\)$/set(DEVELOPMENT_BUILD FALSE)/" CMakeLists.txt || die "Failed to unset DEVELOPMENT_BUILD"
 
-NEXT_VERSION_MINOR=$(prompt_for_number "Set next minor" $NEXT_VERSION_MINOR)
+sed -i -re "s/versionCode [0-9]+$/versionCode $NEW_ANDROID_VERSION_CODE/" build/android/build.gradle || die "Failed to update Android version code"
 
-if [ "$NEXT_VERSION_MINOR" != "$VERSION_MINOR" ]; then
-       NEXT_VERSION_PATCH=0
-fi
+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"
 
-NEXT_VERSION_PATCH=$(prompt_for_number "Set next patch" $NEXT_VERSION_PATCH)
+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"
 
-NEXT_VERSION="$NEXT_VERSION_MAJOR.$NEXT_VERSION_MINOR.$NEXT_VERSION_PATCH"
+git add -f CMakeLists.txt build/android/build.gradle doc/lua_api.txt doc/menu_lua_api.txt || die "git add failed"
 
-echo
-echo "New version: $NEXT_VERSION"
+git commit -m "Bump version to $NEW_VERSION" || die "git commit failed"
 
-########################
-# Return back to devel
-########################
+############
+# Create tag
+############
+
+echo "Tagging $NEW_VERSION"
+
+git tag -a "$NEW_VERSION" -m "$NEW_VERSION" || die 'Adding tag failed'
+
+######################
+# Create revert commit
+######################
+
+echo 'Creating "revert to development" commit'
+
+sed -i -re 's/^set\(DEVELOPMENT_BUILD FALSE\)$/set(DEVELOPMENT_BUILD TRUE)/' CMakeLists.txt || die 'Failed to set DEVELOPMENT_BUILD'
+
+git add -f CMakeLists.txt || die 'git add failed'
 
-back_to_devel
+git commit -m "Continue with $NEW_VERSION-dev" || die 'git commit failed'