From e1dc0eef68f02fc83997897acb34325798a750c7 Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Mon, 15 Aug 2016 18:54:00 -0700 Subject: [PATCH 1/8] Merge pull request #3936 from DonLakeFlyer/BadActive Fix active binding --- src/FlightMap/Widgets/QGCInstrumentWidgetAlternate.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/FlightMap/Widgets/QGCInstrumentWidgetAlternate.qml b/src/FlightMap/Widgets/QGCInstrumentWidgetAlternate.qml index 26d9ad8fddf..de61685db23 100644 --- a/src/FlightMap/Widgets/QGCInstrumentWidgetAlternate.qml +++ b/src/FlightMap/Widgets/QGCInstrumentWidgetAlternate.qml @@ -51,7 +51,7 @@ Rectangle { anchors.leftMargin: _topBottomMargin anchors.left: parent.left size: _innerRadius * 2 - active: active + active: root.active anchors.verticalCenter: parent.verticalCenter } @@ -60,7 +60,7 @@ Rectangle { anchors.leftMargin: _spacing anchors.left: attitude.right size: _innerRadius * 2 - active: active + active: root.active anchors.verticalCenter: parent.verticalCenter } } From 38329302e4c168dde1071f5e8b3b174877a1485e Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Thu, 11 Aug 2016 21:00:58 -0700 Subject: [PATCH 2/8] Merge pull request #3930 from DonLakeFlyer/GStreamerWindows GStreamer windows setup --- src/VideoStreaming/VideoStreaming.cc | 7 +++--- src/VideoStreaming/VideoStreaming.pri | 36 +++++++++++---------------- 2 files changed, 18 insertions(+), 25 deletions(-) diff --git a/src/VideoStreaming/VideoStreaming.cc b/src/VideoStreaming/VideoStreaming.cc index 92bd7e87d9e..69c2fa9b920 100644 --- a/src/VideoStreaming/VideoStreaming.cc +++ b/src/VideoStreaming/VideoStreaming.cc @@ -42,8 +42,7 @@ #endif #if defined(QGC_GST_STREAMING) -#if defined(__macos__) -#ifdef QGC_INSTALL_RELEASE +#if (defined(__macos__) && defined(QGC_INSTALL_RELEASE)) || defined(Q_OS_WIN) static void qgcputenv(const QString& key, const QString& root, const QString& path) { QString value = root + path; @@ -51,7 +50,6 @@ static void qgcputenv(const QString& key, const QString& root, const QString& pa } #endif #endif -#endif void initializeVideoStreaming(int &argc, char* argv[]) { @@ -67,6 +65,9 @@ void initializeVideoStreaming(int &argc, char* argv[]) qgcputenv("GST_PLUGIN_PATH_1_0", currentDir, "/../Frameworks/GStreamer.framework/Versions/Current/lib/gstreamer-1.0"); qgcputenv("GST_PLUGIN_PATH", currentDir, "/../Frameworks/GStreamer.framework/Versions/Current/lib/gstreamer-1.0"); #endif + #elif defined(Q_OS_WIN) + QString currentDir = QCoreApplication::applicationDirPath(); + qgcputenv("GST_PLUGIN_PATH", currentDir, "/gstreamer-plugins"); #endif // Initialize GStreamer GError* error = NULL; diff --git a/src/VideoStreaming/VideoStreaming.pri b/src/VideoStreaming/VideoStreaming.pri index b13bc9dc059..51b8d4b6504 100644 --- a/src/VideoStreaming/VideoStreaming.pri +++ b/src/VideoStreaming/VideoStreaming.pri @@ -51,34 +51,26 @@ LinuxBuild { GST_ROOT = c:/gstreamer/1.0/x86 exists($$GST_ROOT) { CONFIG += VideoEnabled - LIBS += -L$$GST_ROOT/lib/gstreamer-1.0/static -lgstreamer-1.0 -lgstvideo-1.0 -lgstbase-1.0 - LIBS += -L$$GST_ROOT/lib -lglib-2.0 -lintl -lgobject-2.0 + + LIBS += -L$$GST_ROOT/lib -lgstreamer-1.0 -lgstvideo-1.0 -lgstbase-1.0 + LIBS += -lglib-2.0 -lintl -lgobject-2.0 + INCLUDEPATH += \ $$GST_ROOT/include/gstreamer-1.0 \ $$GST_ROOT/include/glib-2.0 \ $$GST_ROOT/lib/gstreamer-1.0/include \ $$GST_ROOT/lib/glib-2.0/include - } - - COPY_FILE_LIST = \ - $$GST_ROOT\\bin\\libffi-6.dll \ - $$GST_ROOT\\bin\\libglib-2.0-0.dll \ - $$GST_ROOT\\bin\\libgmodule-2.0-0.dll \ - $$GST_ROOT\\bin\\libgobject-2.0-0.dll \ - $$GST_ROOT\\bin\\libgstbase-1.0-0.dll \ - $$GST_ROOT\\bin\\libgstreamer-1.0-0.dll \ - $$GST_ROOT\\bin\\libgstvideo-1.0-0.dll \ - $$GST_ROOT\\bin\\libintl-8.dll \ - $$GST_ROOT\\bin\\liborc-0.4-0.dll \ - $$GST_ROOT\\bin\\libwinpthread-1.dll \ - - DESTDIR_WIN = $$replace(DESTDIR, "/", "\\") - - for(COPY_FILE, COPY_FILE_LIST) { - QMAKE_POST_LINK += $$escape_expand(\\n) $$QMAKE_COPY \"$$COPY_FILE\" \"$$DESTDIR_WIN\" - } - QMAKE_POST_LINK += $$escape_expand(\\n) + DESTDIR_WIN = $$replace(DESTDIR, "/", "\\") + GST_ROOT_WIN = $$replace(GST_ROOT, "/", "\\") + + # Copy main GStreamer runtime files + QMAKE_POST_LINK += $$escape_expand(\\n) xcopy \"$$GST_ROOT_WIN\\bin\*.dll\" \"$$DESTDIR_WIN\" /S/Y $$escape_expand(\\n) + QMAKE_POST_LINK += xcopy \"$$GST_ROOT_WIN\\bin\*.\" \"$$DESTDIR_WIN\" /S/Y $$escape_expand(\\n) + + # Copy GStreamer plugins + QMAKE_POST_LINK += $$escape_expand(\\n) xcopy \"$$GST_ROOT_WIN\\lib\\gstreamer-1.0\\*.dll\" \"$$DESTDIR_WIN\\gstreamer-plugins\\\" /S/Y $$escape_expand(\\n) + } } else:AndroidBuild { #- gstreamer assumed to be installed in $$PWD/../../android/gstreamer-1.0-android-armv7-1.5.2 GST_ROOT = $$PWD/../../gstreamer-1.0-android-armv7-1.5.2 From 3e8375a5b8336599b2111499be5e178017f9bb3c Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Fri, 19 Aug 2016 19:10:10 -0700 Subject: [PATCH 3/8] Merge pull request #3958 from NaterGator/unitconvfixes Fix knots to m/s conversion. Oops. --- src/FactSystem/FactMetaData.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FactSystem/FactMetaData.cc b/src/FactSystem/FactMetaData.cc index f9b87557323..d7e551e9e7a 100644 --- a/src/FactSystem/FactMetaData.cc +++ b/src/FactSystem/FactMetaData.cc @@ -446,7 +446,7 @@ QVariant FactMetaData::_metersPerSecondToKnots(const QVariant& metersPerSecond) QVariant FactMetaData::_knotsToMetersPerSecond(const QVariant& knots) { - return QVariant(knots.toDouble() * (constants.knotsToKPH / (1000.0 * constants.secondsPerHour))); + return QVariant(knots.toDouble() * (1000.0 * constants.knotsToKPH / constants.secondsPerHour)); } QVariant FactMetaData::_percentToNorm(const QVariant& percent) From 61940fbd9e3fb6f74b214294baea715aedf9a11a Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Fri, 19 Aug 2016 19:10:23 -0700 Subject: [PATCH 4/8] Merge pull request #3957 from DonLakeFlyer/BatteryCrash Move battery.percentRemainingAnnounce to Qml Global --- src/QmlControls/QGroundControlQmlGlobal.cc | 23 ++++++++++++++++++++++ src/QmlControls/QGroundControlQmlGlobal.h | 4 ++++ src/Vehicle/BatteryFact.json | 10 ---------- src/Vehicle/Vehicle.cc | 16 ++------------- src/Vehicle/Vehicle.h | 10 ---------- src/ui/preferences/GeneralSettings.qml | 2 +- 6 files changed, 30 insertions(+), 35 deletions(-) diff --git a/src/QmlControls/QGroundControlQmlGlobal.cc b/src/QmlControls/QGroundControlQmlGlobal.cc index 264b5f7e61d..b7b7ebd7586 100644 --- a/src/QmlControls/QGroundControlQmlGlobal.cc +++ b/src/QmlControls/QGroundControlQmlGlobal.cc @@ -23,6 +23,8 @@ SettingsFact* QGroundControlQmlGlobal::_distanceUnitsFact = FactMetaData* QGroundControlQmlGlobal::_distanceUnitsMetaData = NULL; SettingsFact* QGroundControlQmlGlobal::_speedUnitsFact = NULL; FactMetaData* QGroundControlQmlGlobal::_speedUnitsMetaData = NULL; +SettingsFact* QGroundControlQmlGlobal::_batteryPercentRemainingAnnounceFact = NULL; +FactMetaData* QGroundControlQmlGlobal::_batteryPercentRemainingAnnounceMetaData = NULL; const char* QGroundControlQmlGlobal::_virtualTabletJoystickKey = "VirtualTabletJoystick"; const char* QGroundControlQmlGlobal::_baseFontPointSizeKey = "BaseDeviceFontPointSize"; @@ -279,3 +281,24 @@ Fact* QGroundControlQmlGlobal::speedUnits(void) return _speedUnitsFact; } + +Fact* QGroundControlQmlGlobal::batteryPercentRemainingAnnounce(void) +{ + if (!_batteryPercentRemainingAnnounceFact) { + QStringList enumStrings; + QVariantList enumValues; + + _batteryPercentRemainingAnnounceFact = new SettingsFact(QString(), "batteryPercentRemainingAnnounce", FactMetaData::valueTypeUint32, 30); + _batteryPercentRemainingAnnounceMetaData = new FactMetaData(FactMetaData::valueTypeUint32); + + _batteryPercentRemainingAnnounceMetaData->setDecimalPlaces(0); + _batteryPercentRemainingAnnounceMetaData->setShortDescription(tr("Percent announce")); + _batteryPercentRemainingAnnounceMetaData->setRawUnits("%"); + _batteryPercentRemainingAnnounceMetaData->setRawMin(0); + _batteryPercentRemainingAnnounceMetaData->setRawMax(100); + + _batteryPercentRemainingAnnounceFact->setMetaData(_batteryPercentRemainingAnnounceMetaData); + } + + return _batteryPercentRemainingAnnounceFact; +} diff --git a/src/QmlControls/QGroundControlQmlGlobal.h b/src/QmlControls/QGroundControlQmlGlobal.h index dd09600ea51..600d8a1d70d 100644 --- a/src/QmlControls/QGroundControlQmlGlobal.h +++ b/src/QmlControls/QGroundControlQmlGlobal.h @@ -84,6 +84,7 @@ class QGroundControlQmlGlobal : public QGCTool Q_PROPERTY(Fact* offlineEditingFirmwareType READ offlineEditingFirmwareType CONSTANT) Q_PROPERTY(Fact* distanceUnits READ distanceUnits CONSTANT) Q_PROPERTY(Fact* speedUnits READ speedUnits CONSTANT) + Q_PROPERTY(Fact* batteryPercentRemainingAnnounce READ batteryPercentRemainingAnnounce CONSTANT) Q_PROPERTY(QGeoCoordinate lastKnownHomePosition READ lastKnownHomePosition CONSTANT) Q_PROPERTY(QGeoCoordinate flightMapPosition MEMBER _flightMapPosition NOTIFY flightMapPositionChanged) @@ -163,6 +164,7 @@ class QGroundControlQmlGlobal : public QGCTool static Fact* offlineEditingFirmwareType (void); static Fact* distanceUnits (void); static Fact* speedUnits (void); + static Fact* batteryPercentRemainingAnnounce(void); //-- TODO: Make this into an actual preference. bool isAdvancedMode () { return false; } @@ -223,6 +225,8 @@ class QGroundControlQmlGlobal : public QGCTool static FactMetaData* _distanceUnitsMetaData; static SettingsFact* _speedUnitsFact; static FactMetaData* _speedUnitsMetaData; + static SettingsFact* _batteryPercentRemainingAnnounceFact; + static FactMetaData* _batteryPercentRemainingAnnounceMetaData; static const char* _virtualTabletJoystickKey; static const char* _baseFontPointSizeKey; diff --git a/src/Vehicle/BatteryFact.json b/src/Vehicle/BatteryFact.json index 484aa240f8e..3c3b861336c 100644 --- a/src/Vehicle/BatteryFact.json +++ b/src/Vehicle/BatteryFact.json @@ -16,16 +16,6 @@ "decimalPlaces": 0, "units": "%" }, - { - "name": "percentRemainingAnnounce", - "shortDescription": "Percent announce", - "type": "int32", - "decimalPlaces": 0, - "units": "%", - "defaultValue": 30, - "min": 0, - "max": 100 - }, { "name": "mahConsumed", "shortDescription": "Consumed", diff --git a/src/Vehicle/Vehicle.cc b/src/Vehicle/Vehicle.cc index 4ba474a0851..9b70b930dad 100644 --- a/src/Vehicle/Vehicle.cc +++ b/src/Vehicle/Vehicle.cc @@ -23,6 +23,7 @@ #include "QGCImageProvider.h" #include "GAudioOutput.h" #include "FollowMe.h" +#include "QGroundControlQmlGlobal.h" QGC_LOGGING_CATEGORY(VehicleLog, "VehicleLog") @@ -585,7 +586,7 @@ void Vehicle::_handleSysStatus(mavlink_message_t& message) } _batteryFactGroup.percentRemaining()->setRawValue(sysStatus.battery_remaining); - if (sysStatus.battery_remaining > 0 && sysStatus.battery_remaining < _batteryFactGroup.percentRemainingAnnounce()->rawValue().toInt()) { + if (sysStatus.battery_remaining > 0 && sysStatus.battery_remaining < QGroundControlQmlGlobal::batteryPercentRemainingAnnounce()->rawValue().toInt()) { if (!_lowBatteryAnnounceTimer.isValid() || _lowBatteryAnnounceTimer.elapsed() > _lowBatteryAnnounceRepeatMSecs) { _lowBatteryAnnounceTimer.restart(); _say(QString("%1 low battery: %2 percent remaining").arg(_vehicleIdSpeech()).arg(sysStatus.battery_remaining)); @@ -1823,14 +1824,12 @@ void VehicleGPSFactGroup::_setSatLoc(UASInterface*, int fix) const char* VehicleBatteryFactGroup::_voltageFactName = "voltage"; const char* VehicleBatteryFactGroup::_percentRemainingFactName = "percentRemaining"; -const char* VehicleBatteryFactGroup::_percentRemainingAnnounceFactName = "percentRemainingAnnounce"; const char* VehicleBatteryFactGroup::_mahConsumedFactName = "mahConsumed"; const char* VehicleBatteryFactGroup::_currentFactName = "current"; const char* VehicleBatteryFactGroup::_temperatureFactName = "temperature"; const char* VehicleBatteryFactGroup::_cellCountFactName = "cellCount"; const char* VehicleBatteryFactGroup::_settingsGroup = "Vehicle.battery"; -const int VehicleBatteryFactGroup::_percentRemainingAnnounceDefault = 30; const double VehicleBatteryFactGroup::_voltageUnavailable = -1.0; const int VehicleBatteryFactGroup::_percentRemainingUnavailable = -1; @@ -1839,8 +1838,6 @@ const int VehicleBatteryFactGroup::_currentUnavailable = -1; const double VehicleBatteryFactGroup::_temperatureUnavailable = -1.0; const int VehicleBatteryFactGroup::_cellCountUnavailable = -1.0; -SettingsFact* VehicleBatteryFactGroup::_percentRemainingAnnounceFact = NULL; - VehicleBatteryFactGroup::VehicleBatteryFactGroup(QObject* parent) : FactGroup(1000, ":/json/Vehicle/BatteryFact.json", parent) , _vehicle(NULL) @@ -1853,7 +1850,6 @@ VehicleBatteryFactGroup::VehicleBatteryFactGroup(QObject* parent) { _addFact(&_voltageFact, _voltageFactName); _addFact(&_percentRemainingFact, _percentRemainingFactName); - _addFact(percentRemainingAnnounce(), _percentRemainingAnnounceFactName); _addFact(&_mahConsumedFact, _mahConsumedFactName); _addFact(&_currentFact, _currentFactName); _addFact(&_temperatureFact, _temperatureFactName); @@ -1873,14 +1869,6 @@ void VehicleBatteryFactGroup::setVehicle(Vehicle* vehicle) _vehicle = vehicle; } -Fact* VehicleBatteryFactGroup::percentRemainingAnnounce(void) -{ - if (!_percentRemainingAnnounceFact) { - _percentRemainingAnnounceFact = new SettingsFact(_settingsGroup, _percentRemainingAnnounceFactName, FactMetaData::valueTypeInt32, _percentRemainingAnnounceDefault); - } - return _percentRemainingAnnounceFact; -} - const char* VehicleWindFactGroup::_directionFactName = "direction"; const char* VehicleWindFactGroup::_speedFactName = "speed"; const char* VehicleWindFactGroup::_verticalSpeedFactName = "verticalSpeed"; diff --git a/src/Vehicle/Vehicle.h b/src/Vehicle/Vehicle.h index ebc398bdff2..771985b8654 100644 --- a/src/Vehicle/Vehicle.h +++ b/src/Vehicle/Vehicle.h @@ -166,12 +166,8 @@ class VehicleBatteryFactGroup : public FactGroup Q_PROPERTY(Fact* temperature READ temperature CONSTANT) Q_PROPERTY(Fact* cellCount READ cellCount CONSTANT) - /// If percentRemaining falls below this value, warning will be output through speech - Q_PROPERTY(Fact* percentRemainingAnnounce READ percentRemainingAnnounce CONSTANT) - Fact* voltage (void) { return &_voltageFact; } Fact* percentRemaining (void) { return &_percentRemainingFact; } - Fact* percentRemainingAnnounce (void); Fact* mahConsumed (void) { return &_mahConsumedFact; } Fact* current (void) { return &_currentFact; } Fact* temperature (void) { return &_temperatureFact; } @@ -182,14 +178,12 @@ class VehicleBatteryFactGroup : public FactGroup static const char* _voltageFactName; static const char* _percentRemainingFactName; - static const char* _percentRemainingAnnounceFactName; static const char* _mahConsumedFactName; static const char* _currentFactName; static const char* _temperatureFactName; static const char* _cellCountFactName; static const char* _settingsGroup; - static const int _percentRemainingAnnounceDefault; static const double _voltageUnavailable; static const int _percentRemainingUnavailable; @@ -206,10 +200,6 @@ class VehicleBatteryFactGroup : public FactGroup Fact _currentFact; Fact _temperatureFact; Fact _cellCountFact; - - /// This fact is global to all Vehicles. We must allocated the first time we need it so we don't - /// run into QSettings application setup ordering issues. - static SettingsFact* _percentRemainingAnnounceFact; }; class Vehicle : public FactGroup diff --git a/src/ui/preferences/GeneralSettings.qml b/src/ui/preferences/GeneralSettings.qml index 9a3e5dfc883..4180161468b 100644 --- a/src/ui/preferences/GeneralSettings.qml +++ b/src/ui/preferences/GeneralSettings.qml @@ -28,7 +28,7 @@ QGCView { anchors.fill: parent anchors.margins: ScreenTools.defaultFontPixelWidth - property Fact _percentRemainingAnnounce: QGroundControl.multiVehicleManager.disconnectedVehicle.battery.percentRemainingAnnounce + property Fact _percentRemainingAnnounce: QGroundControl.batteryPercentRemainingAnnounce property real _editFieldWidth: ScreenTools.defaultFontPixelWidth * 15 QGCPalette { id: qgcPal } From 0d7c9545feb7b018ef32be417b08b29822326d0c Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Sat, 3 Sep 2016 14:11:47 -0400 Subject: [PATCH 5/8] pull proper gstreamer xcopy from master --- src/VideoStreaming/VideoStreaming.pri | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/VideoStreaming/VideoStreaming.pri b/src/VideoStreaming/VideoStreaming.pri index 51b8d4b6504..1b967c8f55f 100644 --- a/src/VideoStreaming/VideoStreaming.pri +++ b/src/VideoStreaming/VideoStreaming.pri @@ -69,7 +69,8 @@ LinuxBuild { QMAKE_POST_LINK += xcopy \"$$GST_ROOT_WIN\\bin\*.\" \"$$DESTDIR_WIN\" /S/Y $$escape_expand(\\n) # Copy GStreamer plugins - QMAKE_POST_LINK += $$escape_expand(\\n) xcopy \"$$GST_ROOT_WIN\\lib\\gstreamer-1.0\\*.dll\" \"$$DESTDIR_WIN\\gstreamer-plugins\\\" /S/Y $$escape_expand(\\n) + QMAKE_POST_LINK += $$escape_expand(\\n) xcopy \"$$GST_ROOT_WIN\\lib\\gstreamer-1.0\\*.dll\" \"$$DESTDIR_WIN\\gstreamer-plugins\\\" /Y $$escape_expand(\\n) + QMAKE_POST_LINK += $$escape_expand(\\n) xcopy \"$$GST_ROOT_WIN\\lib\\gstreamer-1.0\\validate\\*.dll\" \"$$DESTDIR_WIN\\gstreamer-plugins\\validate\\\" /Y $$escape_expand(\\n) } } else:AndroidBuild { #- gstreamer assumed to be installed in $$PWD/../../android/gstreamer-1.0-android-armv7-1.5.2 From 7363c9d58187c5469a37c3b09d0715568116fdf9 Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Sat, 3 Sep 2016 14:36:24 -0400 Subject: [PATCH 6/8] appveyor gstreamer version from master --- .appveyor.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 6aa90392e29..686ad365e88 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -27,19 +27,19 @@ install: Write-Host "Installed" -ForegroundColor Green - ps: | Write-Host "Installing GStreamer..." -ForegroundColor Cyan - $msiPath = "$($env:USERPROFILE)\gstreamer-1.0-x86-1.8.1.msi" + $msiPath = "$($env:USERPROFILE)\gstreamer-1.0-x86-1.5.2.msi" Write-Host "Downloading..." - (New-Object Net.WebClient).DownloadFile('https://s3-us-west-2.amazonaws.com/qgroundcontrol/dependencies/gstreamer-1.0-x86-1.8.1.msi', $msiPath) + (New-Object Net.WebClient).DownloadFile('https://s3-us-west-2.amazonaws.com/qgroundcontrol/dependencies/gstreamer-1.0-x86-1.5.2.msi', $msiPath) Write-Host "Installing..." - cmd /c start /wait msiexec /package $msiPath /passive + cmd /c start /wait msiexec /package $msiPath /passive ADDLOCAL=ALL Write-Host "Installed" -ForegroundColor Green - ps: | Write-Host "Installing GStreamer dev..." -ForegroundColor Cyan - $msiPath = "$($env:USERPROFILE)\gstreamer-1.0-devel-x86-1.8.1.msi" + $msiPath = "$($env:USERPROFILE)\gstreamer-1.0-devel-x86-1.5.2.msi" Write-Host "Downloading..." - (New-Object Net.WebClient).DownloadFile('https://s3-us-west-2.amazonaws.com/qgroundcontrol/dependencies/gstreamer-1.0-devel-x86-1.8.1.msi', $msiPath) + (New-Object Net.WebClient).DownloadFile('https://s3-us-west-2.amazonaws.com/qgroundcontrol/dependencies/gstreamer-1.0-devel-x86-1.5.2.msi', $msiPath) Write-Host "Installing..." - cmd /c start /wait msiexec /package $msiPath /passive + cmd /c start /wait msiexec /package $msiPath /passive ADDLOCAL=ALL Write-Host "Installed" -ForegroundColor Green build_script: From d7e1770ed0dcf88a87cf7abe402595c808b4a363 Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Tue, 13 Sep 2016 20:52:39 -0400 Subject: [PATCH 7/8] android set versionCode from git describe -we need a monotonically increasing integer for android versionCode and this works better across multiple branches --- android/AndroidManifest.xml | 2 +- tools/update_android_version.sh | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index 4afe95caa95..06d2323b768 100644 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/update_android_version.sh b/tools/update_android_version.sh index 4734957f19f..7b98cca2a8e 100755 --- a/tools/update_android_version.sh +++ b/tools/update_android_version.sh @@ -1,12 +1,15 @@ #!/usr/bin/env bash -# this requires `origin/master` in the git tree - -MANIFEST_FILE=android/AndroidManifest.xml - -VERSIONCODE=`git rev-list origin/master --first-parent --count` VERSIONNAME=`git describe --always --tags | sed -e 's/^v//'` +# Android versionCode from git tag vX.Y.Z-123-gSHA +IFS=. read major minor patch dev sha <<<"${VERSIONNAME//-/.}" +VERSIONCODE=$(($major*100000)) +VERSIONCODE=$(($(($minor*10000)) + $VERSIONCODE)) +VERSIONCODE=$(($(($patch*1000)) + $VERSIONCODE)) +VERSIONCODE=$(($(($dev)) + $VERSIONCODE)) + +MANIFEST_FILE=android/AndroidManifest.xml if [ -n "$VERSIONCODE" ]; then sed -i -e "s/android:versionCode=\"[0-9][0-9]*\"/android:versionCode=\"$VERSIONCODE\"/" $MANIFEST_FILE echo "Android version: ${VERSIONCODE}" @@ -22,3 +25,4 @@ else echo "Error versionName empty" exit 0 # don't cause the build to fail fi + From c74b368c44309f8681db6423b566f941bc79d6e8 Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Wed, 14 Sep 2016 08:37:33 -0400 Subject: [PATCH 8/8] android deploy releases to beta first then production --- .travis.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3dafcca1c3d..72faedd8f1b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -185,16 +185,26 @@ after_success: # android google play deploy - export GOOGLE_PLAY_TRACK=none; + + # master development builds to beta track + # tagged releases first to beta track then move to production - if [ "${TRAVIS_TAG}" ]; then GOOGLE_PLAY_TRACK=production; elif [ "${TRAVIS_BRANCH}" = "master" ]; then GOOGLE_PLAY_TRACK=beta; fi + # deploy beta - if [[ "${SPEC}" = "android-g++" && "${TRAVIS_PULL_REQUEST}" = "false" && "${GOOGLE_PLAY_TRACK}" != "none" ]]; then pip install --user google-api-python-client PyOpenSSL && - echo "Google Play Track:" ${GOOGLE_PLAY_TRACK} && + echo "Google Play Track beta" && + openssl aes-256-cbc -K $encrypted_25db6eb7c3fd_key -iv $encrypted_25db6eb7c3fd_iv -in android/Google_Play_Android_Developer-4432a3c4f5d1.json.enc -out android/Google_Play_Android_Developer-4432a3c4f5d1.json -d && + ./tools/google_play_upload.py beta org.mavlink.qgroundcontrol ${SHADOW_BUILD_DIR}/release/package/QGroundControl.apk; + fi + # deploy production + - if [[ "${SPEC}" = "android-g++" && "${TRAVIS_PULL_REQUEST}" = "false" && "${GOOGLE_PLAY_TRACK}" = "production" ]]; then + echo "Google Play Track production" && openssl aes-256-cbc -K $encrypted_25db6eb7c3fd_key -iv $encrypted_25db6eb7c3fd_iv -in android/Google_Play_Android_Developer-4432a3c4f5d1.json.enc -out android/Google_Play_Android_Developer-4432a3c4f5d1.json -d && - ./tools/google_play_upload.py ${GOOGLE_PLAY_TRACK} org.mavlink.qgroundcontrol ${SHADOW_BUILD_DIR}/release/package/QGroundControl.apk; + ./tools/google_play_upload.py production org.mavlink.qgroundcontrol ${SHADOW_BUILD_DIR}/release/package/QGroundControl.apk; fi before_deploy: