Update android project after recent modifications related to STK project version
This commit is contained in:
parent
c23f1bbc5b
commit
26d15e9d8b
@ -162,8 +162,9 @@ LOCAL_CFLAGS := -I../lib/angelscript/include \
|
|||||||
-DUSE_GLES2 \
|
-DUSE_GLES2 \
|
||||||
-DHAVE_OGGVORBIS \
|
-DHAVE_OGGVORBIS \
|
||||||
-DNDEBUG \
|
-DNDEBUG \
|
||||||
-DANDROID_PACKAGE_NAME=\"$(PACKAGE_NAME)\" \
|
-DANDROID_PACKAGE_NAME=\"$(PACKAGE_NAME)\" \
|
||||||
-DANDROID_APP_DIR_NAME=\"$(APP_DIR_NAME)\" \
|
-DANDROID_APP_DIR_NAME=\"$(APP_DIR_NAME)\" \
|
||||||
|
-DSUPERTUXKART_VERSION=\"$(PROJECT_VERSION)\" \
|
||||||
-std=gnu++0x
|
-std=gnu++0x
|
||||||
|
|
||||||
LOCAL_STATIC_LIBRARIES := irrlicht bullet enet freetype ifaddrs angelscript \
|
LOCAL_STATIC_LIBRARIES := irrlicht bullet enet freetype ifaddrs angelscript \
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="org.supertuxkart.stk_dbg"
|
package="org.supertuxkart.stk_dbg"
|
||||||
android:versionCode="1"
|
android:versionCode="1"
|
||||||
android:versionName="1.0"
|
android:versionName="git"
|
||||||
android:installLocation="auto">
|
android:installLocation="auto">
|
||||||
|
|
||||||
<!-- This .apk has no Java code itself, so set hasCode to false. -->
|
<!-- This .apk has no Java code itself, so set hasCode to false. -->
|
||||||
|
@ -101,6 +101,14 @@ SDK_PATH - Path to SDK directory
|
|||||||
|
|
||||||
NDK_PATH - Path to NDK directory
|
NDK_PATH - Path to NDK directory
|
||||||
|
|
||||||
|
PROJECT_VERSION - Set Supertuxkart version number, for example "0.9.3" or
|
||||||
|
"git20170409" or whatever.
|
||||||
|
Default is: git.
|
||||||
|
|
||||||
|
PROJECT_CODE - Set Supertuxkart version code that is used in the manifest
|
||||||
|
file.
|
||||||
|
Default is: 1.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
@ -110,29 +118,13 @@ NDK_PATH - Path to NDK directory
|
|||||||
Making a release build is similar to typical compilation, but there are few
|
Making a release build is similar to typical compilation, but there are few
|
||||||
additional things to do.
|
additional things to do.
|
||||||
|
|
||||||
You have to change version numbers. This is important, because assets manager
|
You have to set PROJECT_VERSION variable. This is important, because assets
|
||||||
in STK checks these numbers and detects if already extracted data files are
|
manager in STK checks that value and detects if already extracted data files are
|
||||||
up to date. So that when you will install new STK version, this will force new
|
up to date. So that when you will install new STK version, this will force new
|
||||||
data extraction automatically.
|
data extraction automatically.
|
||||||
|
|
||||||
So that you have to:
|
The PROJECT_CODE variable typically should be set to a value higher than for
|
||||||
|
previous release, so that users will receive the upgrade.
|
||||||
1. Change "data/supertuxkart.git" to "data/supertuxkart.VERSION_NUMBER"
|
|
||||||
|
|
||||||
2. Open "src/utils/constants.cpp" and change:
|
|
||||||
|
|
||||||
const char STK_VERSION[] = "git";
|
|
||||||
|
|
||||||
to
|
|
||||||
|
|
||||||
const char STK_VERSION[] = "VERSION_NUMBER";
|
|
||||||
|
|
||||||
where "VERSION_NUMBER" is for example "0.9.3" or "git20170409" or whatever.
|
|
||||||
|
|
||||||
3. You can also update these lines in "android/AndroidManifest.xml":
|
|
||||||
android:versionCode="1"
|
|
||||||
android:versionName="1.0"
|
|
||||||
|
|
||||||
|
|
||||||
Before compilation you have to set:
|
Before compilation you have to set:
|
||||||
|
|
||||||
|
@ -232,6 +232,51 @@ if [ -z "$BUILD_TOOLS_VER" ] || [ ! -d "$SDK_PATH/build-tools/$BUILD_TOOLS_VER"
|
|||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Set project version and code
|
||||||
|
if [ -f "$DIRNAME/obj/project_version" ]; then
|
||||||
|
PROJECT_VERSION_PREV=$(cat "$DIRNAME/obj/project_version")
|
||||||
|
|
||||||
|
if [ -z "$PROJECT_VERSION" ]; then
|
||||||
|
PROJECT_VERSION="$PROJECT_VERSION_PREV"
|
||||||
|
elif [ "$PROJECT_VERSION" != "$PROJECT_VERSION_PREV" ]; then
|
||||||
|
echo "Error: Compilation of different version has been already made."
|
||||||
|
echo "Run './make.sh clean' first or set PROJECT_VERSION variable" \
|
||||||
|
"to '$PROJECT_VERSION_PREV.'"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$PROJECT_VERSION" ]; then
|
||||||
|
if [ $IS_DEBUG_BUILD -ne 0 ]; then
|
||||||
|
PROJECT_VERSION="git"
|
||||||
|
else
|
||||||
|
echo "Error: Variable PROJECT_VERSION is not set. It must have unique" \
|
||||||
|
"value for release build."
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$PROJECT_CODE" ]; then
|
||||||
|
if [ $IS_DEBUG_BUILD -ne 0 ]; then
|
||||||
|
PROJECT_CODE="1"
|
||||||
|
else
|
||||||
|
echo "Error: Variable PROJECT_CODE is not set."
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -d "$DIRNAME/assets/data" ]; then
|
||||||
|
if [ ! -f "$DIRNAME/assets/data/supertuxkart.$PROJECT_VERSION" ]; then
|
||||||
|
echo "Error: supertuxkart.$PROJECT_VERSION doesn't exist in" \
|
||||||
|
"assets/data directory."
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f "$DIRNAME/obj/project_version" ]; then
|
||||||
|
echo "$PROJECT_VERSION" > "$DIRNAME/obj/project_version"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Standalone toolchain
|
# Standalone toolchain
|
||||||
if [ ! -f "$DIRNAME/obj/make_standalone_toolchain.stamp" ]; then
|
if [ ! -f "$DIRNAME/obj/make_standalone_toolchain.stamp" ]; then
|
||||||
@ -425,6 +470,12 @@ sed -i "s/targetSdkVersion=\".*\"/targetSdkVersion=\"$TARGET_SDK_VERSION\"/g" \
|
|||||||
sed -i "s/package=\".*\"/package=\"$PACKAGE_NAME\"/g" \
|
sed -i "s/package=\".*\"/package=\"$PACKAGE_NAME\"/g" \
|
||||||
"$DIRNAME/AndroidManifest.xml"
|
"$DIRNAME/AndroidManifest.xml"
|
||||||
|
|
||||||
|
sed -i "s/versionName=\".*\"/versionName=\"$PROJECT_VERSION\"/g" \
|
||||||
|
"$DIRNAME/AndroidManifest.xml"
|
||||||
|
|
||||||
|
sed -i "s/versionCode=\".*\"/versionCode=\"$PROJECT_CODE\"/g" \
|
||||||
|
"$DIRNAME/AndroidManifest.xml"
|
||||||
|
|
||||||
cp "banner.png" "$DIRNAME/res/drawable/banner.png"
|
cp "banner.png" "$DIRNAME/res/drawable/banner.png"
|
||||||
cp "$APP_ICON" "$DIRNAME/res/drawable/icon.png"
|
cp "$APP_ICON" "$DIRNAME/res/drawable/icon.png"
|
||||||
convert -scale 72x72 "$APP_ICON" "$DIRNAME/res/drawable-hdpi/icon.png"
|
convert -scale 72x72 "$APP_ICON" "$DIRNAME/res/drawable-hdpi/icon.png"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user