From 133ff1427dd858b15eff88968b2e80c8528dacc2 Mon Sep 17 00:00:00 2001 From: dogmaphobic Date: Fri, 3 Jun 2016 00:57:20 -0400 Subject: [PATCH] Initial App Store build settings. --- .gitignore | 3 ++ build_ios.sh | 16 +++++++ ios/iOS-Info.plist | 12 +++-- ios/iOSForAppStore-Info-Source.plist | 85 +++++++++++++++++++++++++++++++++++ ios/iOSForAppStore-Info.plist | 87 ------------------------------------ ios/qgroundcontrol.xcconfig | 17 +++++++ ios/qgroundcontrol_appstore.xcconfig | 17 +++++++ qgroundcontrol.pro | 6 +++ tools/update_ios_version.sh | 20 +++++++++ 9 files changed, 169 insertions(+), 94 deletions(-) create mode 100755 build_ios.sh create mode 100644 ios/iOSForAppStore-Info-Source.plist delete mode 100644 ios/iOSForAppStore-Info.plist create mode 100644 ios/qgroundcontrol.xcconfig create mode 100644 ios/qgroundcontrol_appstore.xcconfig create mode 100755 tools/update_ios_version.sh diff --git a/.gitignore b/.gitignore index e7e7fba..d06a327 100644 --- a/.gitignore +++ b/.gitignore @@ -60,6 +60,9 @@ gstreamer-1.0-android* *.autosave .settings/ +# iOS Generated files +ios/iOSForAppStore-Info.plist + # Generated files moc_* ui_* diff --git a/build_ios.sh b/build_ios.sh new file mode 100755 index 0000000..eb5220b --- /dev/null +++ b/build_ios.sh @@ -0,0 +1,16 @@ +#!/bin/bash +if [ ! -d /Volumes/RAMDisk ] ; then + echo 'RAM Disk not found' + echo 'Only used for App Store builds. It will not work on your computer.' + exit 1 +fi +#-- Set to my local installation +QMAKE=/Applications/Qt/5.5/ios/bin/qmake +#-- Using Travis variables as this will eventually live there +SHADOW_BUILD_DIR=/Volumes/RAMDisk/build-qgroundcontrol-iOS-Release +TRAVIS_BUILD_DIR=/Users/gus/github/work/qgroundcontrol +#-- Build it +mkdir -p ${SHADOW_BUILD_DIR} && +cd ${SHADOW_BUILD_DIR} && +${QMAKE} -r ${TRAVIS_BUILD_DIR}/qgroundcontrol.pro CONFIG+=WarningsAsErrorsOn CONFIG-=debug_and_release CONFIG+=release CONFIG+=ForAppStore && +xcodebuild -configuration Release -xcconfig ${TRAVIS_BUILD_DIR}/ios/qgroundcontrol_appstore.xcconfig diff --git a/ios/iOS-Info.plist b/ios/iOS-Info.plist index 82db8a4..315ff57 100644 --- a/ios/iOS-Info.plist +++ b/ios/iOS-Info.plist @@ -6,26 +6,24 @@ QGroundControl CFBundleExecutable qgroundcontrol - CFBundleGetInfoString - Created by Qt/QMake + NSHumanReadableCopyright + Open Source Flight Systems GmbH - Internal Build CFBundleIconFile CFBundleIdentifier - org.mavlink.qgroundcontrol + org.QGroundControl.QGCiOS CFBundleName QGroundControl CFBundlePackageType APPL CFBundleShortVersionString - #.#.# + 0.0.0 CFBundleSignature ???? CFBundleVersion - ### + 1 LSRequiresIPhoneOS - NOTE - This file was generated by Qt/QMake. UILaunchStoryboardName QGCLaunchScreen UIRequiresFullScreen diff --git a/ios/iOSForAppStore-Info-Source.plist b/ios/iOSForAppStore-Info-Source.plist new file mode 100644 index 0000000..3b44930 --- /dev/null +++ b/ios/iOSForAppStore-Info-Source.plist @@ -0,0 +1,85 @@ + + + + + CFBundleDisplayName + QGroundControl + CFBundleExecutable + qgroundcontrol + NSHumanReadableCopyright + Open Source Flight Systems GmbH + CFBundleIconFile + + CFBundleIcons + + CFBundlePrimaryIcon + + CFBundleIconFiles + + AppIcon29x29.png + AppIcon29x29@2x.png + AppIcon40x40@2x.png + AppIcon57x57.png + AppIcon57x57@2x.png + AppIcon60x60@2x.png + + + + CFBundleIcons~ipad + + CFBundlePrimaryIcon + + CFBundleIconFiles + + AppIcon29x29.png + AppIcon29x29@2x.png + AppIcon40x40@2x.png + AppIcon57x57.png + AppIcon57x57@2x.png + AppIcon60x60@2x.png + AppIcon29x29~ipad.png + AppIcon29x29@2x~ipad.png + AppIcon40x40~ipad.png + AppIcon40x40@2x~ipad.png + AppIcon50x50~ipad.png + AppIcon50x50@2x~ipad.png + AppIcon72x72~ipad.png + AppIcon72x72@2x~ipad.png + AppIcon76x76~ipad.png + AppIcon76x76@2x~ipad.png + + + + CFBundleIdentifier + org.QGroundControl.QGCiOS + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + QGroundControl + CFBundlePackageType + APPL + CFBundleShortVersionString + ###VERSION### + CFBundleSignature + ???? + CFBundleVersion + ###BUILD### + ForAppStore + Yes + LSRequiresIPhoneOS + + NSLocationUsageDescription + Ground Station Location + NSLocationWhenInUseUsageDescription + Ground Station Location + UILaunchStoryboardName + QGCLaunchScreen + UIRequiresFullScreen + + UISupportedInterfaceOrientations + + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/ios/iOSForAppStore-Info.plist b/ios/iOSForAppStore-Info.plist deleted file mode 100644 index 0312e0b..0000000 --- a/ios/iOSForAppStore-Info.plist +++ /dev/null @@ -1,87 +0,0 @@ - - - - - CFBundleDisplayName - QGroundControl - CFBundleExecutable - qgroundcontrol - CFBundleGetInfoString - Created by Qt/QMake - CFBundleIconFile - - CFBundleIdentifier - com.grubba.qgroundcontrol - CFBundleName - QGroundControl - CFBundlePackageType - APPL - CFBundleShortVersionString - #.#.# - CFBundleSignature - ???? - CFBundleVersion - ### - LSRequiresIPhoneOS - - NOTE - This file was generated by Qt/QMake. - UILaunchStoryboardName - QGCLaunchScreen - UIRequiresFullScreen - - CFBundleInfoDictionaryVersion - 6.0 - ForAppStore - Yes - NSLocationUsageDescription - Ground Station Location - NSLocationWhenInUseUsageDescription - Ground Station Location - UISupportedInterfaceOrientations - - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - CFBundleIcons - - CFBundlePrimaryIcon - - CFBundleIconFiles - - AppIcon29x29.png - AppIcon29x29@2x.png - AppIcon40x40@2x.png - AppIcon57x57.png - AppIcon57x57@2x.png - AppIcon60x60@2x.png - - - - CFBundleIcons~ipad - - CFBundlePrimaryIcon - - CFBundleIconFiles - - AppIcon29x29.png - AppIcon29x29@2x.png - AppIcon40x40@2x.png - AppIcon57x57.png - AppIcon57x57@2x.png - AppIcon60x60@2x.png - AppIcon29x29~ipad.png - AppIcon29x29@2x~ipad.png - AppIcon40x40~ipad.png - AppIcon40x40@2x~ipad.png - AppIcon50x50~ipad.png - AppIcon50x50@2x~ipad.png - AppIcon72x72~ipad.png - AppIcon72x72@2x~ipad.png - AppIcon76x76~ipad.png - AppIcon76x76@2x~ipad.png - - - - - diff --git a/ios/qgroundcontrol.xcconfig b/ios/qgroundcontrol.xcconfig new file mode 100644 index 0000000..646c6dd --- /dev/null +++ b/ios/qgroundcontrol.xcconfig @@ -0,0 +1,17 @@ +CODE_SIGN_IDENTITY = ""; +CODE_SIGNING_REQUIRED = NO; +CLANG_WARN_BOOL_CONVERSION = YES; +CLANG_WARN_CONSTANT_CONVERSION = YES; +CLANG_WARN_EMPTY_BODY = YES; +CLANG_WARN_ENUM_CONVERSION = YES; +CLANG_WARN_INT_CONVERSION = YES; +CLANG_WARN_UNREACHABLE_CODE = YES; +CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; +ENABLE_STRICT_OBJC_MSGSEND = YES; +GCC_NO_COMMON_BLOCKS = YES; +GCC_WARN_64_TO_32_BIT_CONVERSION = YES; +GCC_WARN_ABOUT_RETURN_TYPE = YES; +GCC_WARN_UNDECLARED_SELECTOR = YES; +GCC_WARN_UNINITIALIZED_AUTOS = YES; +GCC_WARN_UNUSED_FUNCTION = YES; +GCC_WARN_UNUSED_VARIABLE = YES; diff --git a/ios/qgroundcontrol_appstore.xcconfig b/ios/qgroundcontrol_appstore.xcconfig new file mode 100644 index 0000000..4ad27bc --- /dev/null +++ b/ios/qgroundcontrol_appstore.xcconfig @@ -0,0 +1,17 @@ +CODE_SIGN_IDENTITY = "iPhone Distribution"; +PROVISIONING_PROFILE = 11a5f941-2284-40f1-95ad-50005b648377; +CLANG_WARN_BOOL_CONVERSION = YES; +CLANG_WARN_CONSTANT_CONVERSION = YES; +CLANG_WARN_EMPTY_BODY = YES; +CLANG_WARN_ENUM_CONVERSION = YES; +CLANG_WARN_INT_CONVERSION = YES; +CLANG_WARN_UNREACHABLE_CODE = YES; +CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; +ENABLE_STRICT_OBJC_MSGSEND = YES; +GCC_NO_COMMON_BLOCKS = YES; +GCC_WARN_64_TO_32_BIT_CONVERSION = YES; +GCC_WARN_ABOUT_RETURN_TYPE = YES; +GCC_WARN_UNDECLARED_SELECTOR = YES; +GCC_WARN_UNINITIALIZED_AUTOS = YES; +GCC_WARN_UNUSED_FUNCTION = YES; +GCC_WARN_UNUSED_VARIABLE = YES; diff --git a/qgroundcontrol.pro b/qgroundcontrol.pro index 20e79d2..74b6dc9 100644 --- a/qgroundcontrol.pro +++ b/qgroundcontrol.pro @@ -117,6 +117,12 @@ iOSBuild { #-- Info.plist (need an "official" one for the App Store) ForAppStore { message(App Store Build) + #-- Create official, versioned Info.plist + APP_STORE = $$system(cd $${BASEDIR} && $${BASEDIR}/tools/update_ios_version.sh $${BASEDIR}/ios/iOSForAppStore-Info-Source.plist $${BASEDIR}/ios/iOSForAppStore-Info.plist) + APP_ERROR = $$find(APP_STORE, "Error") + count(APP_ERROR, 1) { + error("Error building .plist file. 'ForAppStore' builds are only possible through the official build system.") + } QMAKE_INFO_PLIST = $${BASEDIR}/ios/iOSForAppStore-Info.plist OTHER_FILES += $${BASEDIR}/ios/iOSForAppStore-Info.plist } else { diff --git a/tools/update_ios_version.sh b/tools/update_ios_version.sh new file mode 100755 index 0000000..3d5b79a --- /dev/null +++ b/tools/update_ios_version.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +# this requires `master` in the git tree +# travis-ci branch builds are unable to set the version properly + +PLIST_FILE_SRC=$1 +PLIST_FILE_DST=$2 + +BUILD_CODE=`git rev-list master --first-parent --count` +VERSION_CODE=`git describe --always --tags | sed -e 's/[^0-9.]*\([0-9.]*\).*/\1/'` + +if [ -z "$BUILD_CODE" -o -z "$VERSION_CODE" ]; then + echo "Error: Version and/or build empty." + exit 1 # Cause the build to fail +else + echo "Version: ${VERSION_CODE}" + echo "Build: ${BUILD_CODE}" +fi + +sed -e "s/\###BUILD###/${BUILD_CODE}/" -e "s/\###VERSION###/${VERSION_CODE}/" $PLIST_FILE_SRC > $PLIST_FILE_DST