Commit 1a960233 authored by Daniel Agar's avatar Daniel Agar

android only update AndroidManifest if versionCode not empty

parent 29facda3
......@@ -65,7 +65,7 @@ cache:
before_install:
- cd ${TRAVIS_BUILD_DIR} && git fetch --unshallow && git fetch --tags
- cd ${TRAVIS_BUILD_DIR} && git fetch --unshallow && git fetch --all --tags
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then mkdir -p ~/.config/QtProject/ && cp ${TRAVIS_BUILD_DIR}/test/qtlogging.ini ~/.config/QtProject/; fi
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then mkdir -p ~/Library/Preferences/QtProject/ && cp ${TRAVIS_BUILD_DIR}/test/qtlogging.ini ~/Library/Preferences/QtProject/; fi
- if [ "${TRAVIS_OS_NAME}" = "android" ]; then wget https://s3-us-west-2.amazonaws.com/qgroundcontrol/dependencies/gstreamer-1.0-android-armv7-1.5.2.tar.bz2 && mkdir -p ${TRAVIS_BUILD_DIR}/gstreamer-1.0-android-armv7-1.5.2 && tar jxf gstreamer-1.0-android-armv7-1.5.2.tar.bz2 -C ${TRAVIS_BUILD_DIR}/gstreamer-1.0-android-armv7-1.5.2; fi
......
......@@ -8,5 +8,14 @@ VERSIONNAME=`git describe --always --tags | sed -e 's/^v//'`
echo "VersionCode: ${VERSIONCODE}"
echo "VersionName: ${VERSIONNAME}"
sed -i -e "s/android:versionCode=\"[0-9][0-9]*\"/android:versionCode=\"${VERSIONCODE}\"/" $MANIFEST_FILE
sed -i -e 's/versionName *= *"[^"]*"/versionName="'$VERSIONNAME'"/' $MANIFEST_FILE
if [ -n "$VERSIONCODE" ]; then
sed -i -e "s/android:versionCode=\"[0-9][0-9]*\"/android:versionCode=\"$VERSIONCODE\"/" $MANIFEST_FILE
else
echo "Error versionCode empty"
fi
if [ -n "$VERSIONNAME" ]; then
sed -i -e 's/versionName *= *"[^"]*"/versionName="'$VERSIONNAME'"/' $MANIFEST_FILE
else
echo "Error versionName empty"
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment