Browse Source

Merge pull request #2957 from DonLakeFlyer/MacVersion

Correct version info for all OSX/iOS builds
QGC4.4
Don Gagne 9 years ago
parent
commit
299865e519
  1. 4
      Custom-Info.plist
  2. 10
      QGCCommon.pri
  3. 6
      QGCSetup.pri
  4. 4
      ios/iOS-Info.plist
  5. 4
      ios/iOSForAppStore-Info.plist
  6. 12
      src/Vehicle/Vehicle.cc
  7. 6
      src/Vehicle/Vehicle.h

4
Custom-Info.plist

@ -9,9 +9,9 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>227</string> <string>###</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>2.0.0</string> <string>#.#.#</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>

10
QGCCommon.pri

@ -93,11 +93,19 @@ exists ($$PWD/.git) {
VERSION = $$replace(GIT_DESCRIBE, "v", "") VERSION = $$replace(GIT_DESCRIBE, "v", "")
VERSION = $$replace(VERSION, "-", ".") VERSION = $$replace(VERSION, "-", ".")
VERSION = $$section(VERSION, ".", 0, 3) VERSION = $$section(VERSION, ".", 0, 3)
message(QGroundControl version $${GIT_DESCRIBE} hash $${GIT_HASH}) 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})
} else {
message(QGroundControl version $${VERSION} describe $${GIT_DESCRIBE} hash $${GIT_HASH})
}
} else { } else {
GIT_DESCRIBE = None GIT_DESCRIBE = None
GIT_HASH = None GIT_HASH = None
VERSION = 0.0.0 # Marker to indicate out-of-tree build 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_TAG=\"\\\"$$GIT_DESCRIBE\\\"\"

6
QGCSetup.pri

@ -50,6 +50,12 @@ WindowsBuild {
# Perform platform specific setup # Perform platform specific setup
# #
iOSBuild | MacBuild {
# Update version info in bundle
QMAKE_POST_LINK += && /usr/libexec/PlistBuddy -c \"Set :CFBundleShortVersionString $${MAC_VERSION}\" $$DESTDIR/$${TARGET}.app/Contents/Info.plist
QMAKE_POST_LINK += && /usr/libexec/PlistBuddy -c \"Set :CFBundleVersion $${MAC_BUILD}\" $$DESTDIR/$${TARGET}.app/Contents/Info.plist
}
MacBuild { MacBuild {
# Copy non-standard frameworks into app package # Copy non-standard frameworks into app package
QMAKE_POST_LINK += && rsync -a --delete $$BASEDIR/libs/lib/Frameworks $$DESTDIR/$${TARGET}.app/Contents/ QMAKE_POST_LINK += && rsync -a --delete $$BASEDIR/libs/lib/Frameworks $$DESTDIR/$${TARGET}.app/Contents/

4
ios/iOS-Info.plist

@ -17,11 +17,11 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>1.0</string> <string>#.#.#</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>1.0</string> <string>###</string>
<key>LSRequiresIPhoneOS</key> <key>LSRequiresIPhoneOS</key>
<true/> <true/>
<key>NOTE</key> <key>NOTE</key>

4
ios/iOSForAppStore-Info.plist

@ -17,11 +17,11 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>1.0</string> <string>#.#.#</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>1.0</string> <string>###</string>
<key>LSRequiresIPhoneOS</key> <key>LSRequiresIPhoneOS</key>
<true/> <true/>
<key>NOTE</key> <key>NOTE</key>

12
src/Vehicle/Vehicle.cc

@ -1461,7 +1461,7 @@ const int VehicleBatteryFactGroup::_currentUnavailable = -1;
const double VehicleBatteryFactGroup::_temperatureUnavailable = -1.0; const double VehicleBatteryFactGroup::_temperatureUnavailable = -1.0;
const int VehicleBatteryFactGroup::_cellCountUnavailable = -1.0; const int VehicleBatteryFactGroup::_cellCountUnavailable = -1.0;
SettingsFact VehicleBatteryFactGroup::_percentRemainingAnnounceFact (_settingsGroup, _percentRemainingAnnounceFactName, FactMetaData::valueTypeInt32, _percentRemainingAnnounceDefault); SettingsFact* VehicleBatteryFactGroup::_percentRemainingAnnounceFact = NULL;
VehicleBatteryFactGroup::VehicleBatteryFactGroup(QObject* parent) VehicleBatteryFactGroup::VehicleBatteryFactGroup(QObject* parent)
: FactGroup(1000, ":/json/Vehicle/BatteryFact.json", parent) : FactGroup(1000, ":/json/Vehicle/BatteryFact.json", parent)
@ -1475,7 +1475,7 @@ VehicleBatteryFactGroup::VehicleBatteryFactGroup(QObject* parent)
{ {
_addFact(&_voltageFact, _voltageFactName); _addFact(&_voltageFact, _voltageFactName);
_addFact(&_percentRemainingFact, _percentRemainingFactName); _addFact(&_percentRemainingFact, _percentRemainingFactName);
_addFact(&_percentRemainingAnnounceFact, _percentRemainingAnnounceFactName); _addFact(percentRemainingAnnounce(), _percentRemainingAnnounceFactName);
_addFact(&_mahConsumedFact, _mahConsumedFactName); _addFact(&_mahConsumedFact, _mahConsumedFactName);
_addFact(&_currentFact, _currentFactName); _addFact(&_currentFact, _currentFactName);
_addFact(&_temperatureFact, _temperatureFactName); _addFact(&_temperatureFact, _temperatureFactName);
@ -1495,6 +1495,14 @@ void VehicleBatteryFactGroup::setVehicle(Vehicle* vehicle)
_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::_directionFactName = "direction";
const char* VehicleWindFactGroup::_speedFactName = "speed"; const char* VehicleWindFactGroup::_speedFactName = "speed";
const char* VehicleWindFactGroup::_verticalSpeedFactName = "verticalSpeed"; const char* VehicleWindFactGroup::_verticalSpeedFactName = "verticalSpeed";

6
src/Vehicle/Vehicle.h

@ -184,7 +184,7 @@ public:
Fact* voltage (void) { return &_voltageFact; } Fact* voltage (void) { return &_voltageFact; }
Fact* percentRemaining (void) { return &_percentRemainingFact; } Fact* percentRemaining (void) { return &_percentRemainingFact; }
Fact* percentRemainingAnnounce (void) { return &_percentRemainingAnnounceFact; } Fact* percentRemainingAnnounce (void);
Fact* mahConsumed (void) { return &_mahConsumedFact; } Fact* mahConsumed (void) { return &_mahConsumedFact; }
Fact* current (void) { return &_currentFact; } Fact* current (void) { return &_currentFact; }
Fact* temperature (void) { return &_temperatureFact; } Fact* temperature (void) { return &_temperatureFact; }
@ -220,7 +220,9 @@ private:
Fact _temperatureFact; Fact _temperatureFact;
Fact _cellCountFact; Fact _cellCountFact;
static SettingsFact _percentRemainingAnnounceFact; /// 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 class Vehicle : public FactGroup

Loading…
Cancel
Save