diff --git a/QGCCommon.pri b/QGCCommon.pri index 5caef6271b39c0608cef35048be2dc99c6614ac6..7f274829e6d6a77b8e8ec1d6f561dec07b67cd95 100644 --- a/QGCCommon.pri +++ b/QGCCommon.pri @@ -100,27 +100,38 @@ MobileBuild { exists ($$PWD/.git) { GIT_DESCRIBE = $$system(git --git-dir $$PWD/.git --work-tree $$PWD describe --always --tags) - GIT_HASH = $$system(git rev-parse HEAD) + GIT_BRANCH = $$system(git --git-dir $$PWD/.git --work-tree $$PWD rev-parse --abbrev-ref HEAD) + GIT_HASH = $$system(git --git-dir $$PWD/.git --work-tree $$PWD rev-parse --short HEAD) + GIT_TIME = $$system(git --git-dir $$PWD/.git --work-tree $$PWD show --oneline --format=\"%ci\" -s HEAD) + + # determine if we're on a tag matching vX.Y.Z (stable release) + GIT_TAG = $$system(git --git-dir $$PWD/.git --work-tree $$PWD describe --exact-match --tags HEAD) + contains(GIT_TAG, v[0-9].[0-9].[0-9]) { + # release version "vX.Y.Z" + GIT_VERSION = $${GIT_DESCRIBE} + } else { + # development version "Development branch:sha date" + GIT_VERSION = "Development $${GIT_BRANCH}:$${GIT_HASH} $${GIT_TIME}" + } + VERSION = $$replace(GIT_DESCRIBE, "v", "") VERSION = $$replace(VERSION, "-", ".") VERSION = $$section(VERSION, ".", 0, 3) MacBuild { MAC_VERSION = $$section(VERSION, ".", 0, 2) MAC_BUILD = $$section(VERSION, ".", 3, 3) - message(QGroundControl version $${MAC_VERSION} build $${MAC_BUILD} describe $${GIT_DESCRIBE} hash $${GIT_HASH}) + message(QGroundControl version $${MAC_VERSION} build $${MAC_BUILD} describe $${GIT_VERSION}) } else { - message(QGroundControl version $${VERSION} describe $${GIT_DESCRIBE} hash $${GIT_HASH}) + message(QGroundControl version $${VERSION} describe $${GIT_VERSION}) } } else { - GIT_DESCRIBE = None - GIT_HASH = None + GIT_VERSION = None VERSION = 0.0.0 # Marker to indicate out-of-tree build MAC_VERSION = 0.0.0 MAC_BUILD = 0 } -DEFINES += GIT_TAG=\"\\\"$$GIT_DESCRIBE\\\"\" -DEFINES += GIT_HASH=\"\\\"$$GIT_HASH\\\"\" +DEFINES += GIT_VERSION=\"\\\"$$GIT_VERSION\\\"\" DEFINES += EIGEN_MPL2_ONLY # Installer configuration diff --git a/QGCInstaller.pri b/QGCInstaller.pri index de98aa7d1d37d68928c0a45d2dd89cd170c2b5cb..7e7fa2eb12bf6a414afba131121340f7dfacc5b4 100644 --- a/QGCInstaller.pri +++ b/QGCInstaller.pri @@ -29,7 +29,7 @@ installer { QMAKE_POST_LINK += && mkdir -p $${DESTDIR}/package QMAKE_POST_LINK += && cd $${DESTDIR} && $$dirname(QMAKE_QMAKE)/macdeployqt qgroundcontrol.app -appstore-compliant -verbose=2 -qmldir=$${BASEDIR}/src QMAKE_POST_LINK += && cd $${OUT_PWD} - QMAKE_POST_LINK += && hdiutil create -verbose -stretch 1g -layout SPUD -srcfolder $${DESTDIR}/qgroundcontrol.app -volname QGroundControl $${DESTDIR}/package/qgroundcontrol.dmg + QMAKE_POST_LINK += && hdiutil create -verbose -stretch 1g -layout SPUD -srcfolder $${DESTDIR}/qgroundcontrol.app -volname QGroundControl $${DESTDIR}/package/QGroundControl.dmg } WindowsBuild { # The pdb moving command are commented out for now since we are including the .pdb in the installer. This makes it much @@ -44,13 +44,13 @@ installer { LinuxBuild { #-- TODO: This uses hardcoded paths. It should use $${DESTDIR} QMAKE_POST_LINK += && mkdir -p release/package - QMAKE_POST_LINK += && tar -cjf release/package/qgroundcontrol.tar.bz2 release --exclude='package' --transform 's/release/qgroundcontrol/' + QMAKE_POST_LINK += && tar -cjf release/package/QGroundControl.tar.bz2 release --exclude='package' --transform 's/release/qgroundcontrol/' } AndroidBuild { #-- TODO: This uses hardcoded paths. It should use $${DESTDIR} QMAKE_POST_LINK += && mkdir -p $${DESTDIR}/package QMAKE_POST_LINK += && make install INSTALL_ROOT=$${DESTDIR}/android-build/ - QMAKE_POST_LINK += && androiddeployqt --input android-libqgroundcontrol.so-deployment-settings.json --output $${DESTDIR}/android-build --deployment bundled --gradle --sign $${BASEDIR}/android/android_release.keystore dagar --storepass $$(ANDROID_STOREPASS) - QMAKE_POST_LINK += && cp $${DESTDIR}/android-build/build/outputs/apk/android-build-release-signed.apk $${DESTDIR}/package/qgroundcontrol.apk + QMAKE_POST_LINK += && androiddeployqt --input android-libQGroundControl.so-deployment-settings.json --output $${DESTDIR}/android-build --deployment bundled --gradle --sign $${BASEDIR}/android/android_release.keystore dagar --storepass $$(ANDROID_STOREPASS) + QMAKE_POST_LINK += && cp $${DESTDIR}/android-build/build/outputs/apk/android-build-release-signed.apk $${DESTDIR}/package/QGroundControl.apk } } diff --git a/android_environment.sh b/android_environment.sh index 04abee5d505eb0cd56e001ec42982cfdc4766b91..3cfba9ac111550fa92874e57053db4bf85d7b14d 100644 --- a/android_environment.sh +++ b/android_environment.sh @@ -25,5 +25,5 @@ export ANDROID_NDK_TOOLS_PREFIX=arm-linux-androideabi # cd android_build # >~/local/Qt/5.4/android_armv7/bin/qmake -r -spec android-g++ CONFIG+=debug ../qgroundcontrol/qgroundcontrol.pro # >make -j24 install INSTALL_ROOT=./android-build/ -# >~/local/Qt/5.4/android_armv7/bin/androiddeployqt --input ./android-libqgroundcontrol.so-deployment-settings.json --output ./android-build --deployment bundled --android-platform android-22 --jdk /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home --verbose --ant /usr/local/bin/ant +# >~/local/Qt/5.4/android_armv7/bin/androiddeployqt --input ./android-libQGroundControl.so-deployment-settings.json --output ./android-build --deployment bundled --android-platform android-22 --jdk /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home --verbose --ant /usr/local/bin/ant # diff --git a/deploy/create_linux_appimage.sh b/deploy/create_linux_appimage.sh index 6a75cff9946ba4a7f0b324aef86ad468704d7297..5ebb9bd80c9842cb454a3fe225757a9b0aed0bed 100755 --- a/deploy/create_linux_appimage.sh +++ b/deploy/create_linux_appimage.sh @@ -14,8 +14,8 @@ if [ ! -f ${QGC_SRC}/qgroundcontrol.pro ]; then fi QGC_RELEASE_DIR=$2 -if [ ! -f ${QGC_RELEASE_DIR}/qgroundcontrol ]; then - echo 'please specify path to qgroundcontrol release as the 2nd argument' +if [ ! -f ${QGC_RELEASE_DIR}/QGroundControl ]; then + echo 'please specify path to QGroundControl release as the 2nd argument' exit 1 fi diff --git a/src/QGCApplication.cc b/src/QGCApplication.cc index a28fb372ff09233809b0a637210e34ff73f87238..697fc95c0bd6fdf0e35a828a2bfbf279a874787a 100644 --- a/src/QGCApplication.cc +++ b/src/QGCApplication.cc @@ -274,13 +274,7 @@ QGCApplication::QGCApplication(int &argc, char* argv[], bool unitTesting) setOrganizationName(QGC_ORG_NAME); setOrganizationDomain(QGC_ORG_DOMAIN); - QString versionString(GIT_TAG); - // stable versions are on tags (v1.2.3) - // development versions are full git describe versions (v1.2.3-18-g879e8b3) - if (versionString.length() > 8) { - versionString.append(" (Development)"); - } - this->setApplicationVersion(versionString); + this->setApplicationVersion(QString(GIT_VERSION)); // Set settings format QSettings::setDefaultFormat(QSettings::IniFormat);