diff --git a/scripts/common.py b/scripts/common.py index b8f640377ec..91ff78ad4ef 100644 --- a/scripts/common.py +++ b/scripts/common.py @@ -177,3 +177,13 @@ def is_debug(path, filenames): def is_not_debug(path, filenames): files = [fn for fn in filenames if os.path.isfile(os.path.join(path, fn))] return [fn for fn in files if not is_debug_file(os.path.join(path, fn))] + +def codesign(app_path): + signing_identity = os.environ.get('SIGNING_IDENTITY') + if is_mac_platform() and signing_identity: + codesign_call = ['codesign', '--force', '--deep', '-s', signing_identity, '-v'] + signing_flags = os.environ.get('SIGNING_FLAGS') + if signing_flags: + codesign_call.extend(signing_flags.split()) + codesign_call.append(app_path) + subprocess.check_call(codesign_call) diff --git a/scripts/createDistPackage.py b/scripts/createDistPackage.py index 2b0c38ea5f4..a2bdf1bd193 100755 --- a/scripts/createDistPackage.py +++ b/scripts/createDistPackage.py @@ -33,7 +33,8 @@ import tempfile import common def parse_arguments(): - parser = argparse.ArgumentParser(description="Create Qt Creator package, filtering out debug information files.") + parser = argparse.ArgumentParser(description="Create Qt Creator package, filtering out debug information files.", + epilog="To sign the contents before packaging on macOS, set the SIGNING_IDENTITY and optionally the SIGNING_FLAGS environment variables.") parser.add_argument('--7z', help='path to 7z binary', default='7z.exe' if common.is_windows_platform() else '7z', metavar='<7z_binary>', dest='sevenzip') @@ -52,6 +53,10 @@ def main(): try: common.copytree(arguments.source_directory, tempdir, symlinks=True, ignore=(common.is_not_debug if arguments.debug else common.is_debug)) + # on macOS we might have to codesign (again) to account for removed debug info + if not arguments.debug: + common.codesign(tempdir) + # package zip_source = os.path.join(tempdir, '*') if arguments.exclude_toplevel else tempdir subprocess.check_call([arguments.sevenzip, 'a', '-mx9', arguments.target_archive, zip_source]) diff --git a/scripts/makedmg.py b/scripts/makedmg.py index 33721f90a72..7911a1be000 100755 --- a/scripts/makedmg.py +++ b/scripts/makedmg.py @@ -34,7 +34,8 @@ import time import common def parse_arguments(): - parser = argparse.ArgumentParser(description='Create Qt Creator disk image, filtering out debug information files.') + parser = argparse.ArgumentParser(description='Create Qt Creator disk image, filtering out debug information files.', + epilog="To sign the contents before packaging on macOS, set the SIGNING_IDENTITY and optionally the SIGNING_FLAGS environment variables.") parser.add_argument('target_diskimage', help='output .dmg file to create') parser.add_argument('dmg_volumename', help='volume name to use for the disk image') parser.add_argument('source_directory', help='directory with the Qt Creator sources') @@ -47,6 +48,9 @@ def main(): tempdir = os.path.join(tempdir_base, os.path.basename(arguments.binary_directory)) try: common.copytree(arguments.binary_directory, tempdir, symlinks=True, ignore=common.is_debug) + if common.is_mac_platform(): + app_path = [app for app in os.listdir(tempdir) if app.endswith('.app')][0] + common.codesign(os.path.join(tempdir, app_path)) os.symlink('/Applications', os.path.join(tempdir, 'Applications')) shutil.copy(os.path.join(arguments.source_directory, 'LICENSE.GPL3-EXCEPT'), tempdir) dmg_cmd = ['hdiutil', 'create', '-srcfolder', tempdir, '-volname', arguments.dmg_volumename, diff --git a/src/plugins/android/androidtoolchain.cpp b/src/plugins/android/androidtoolchain.cpp index 55940fa5a98..ffdef58e9d7 100644 --- a/src/plugins/android/androidtoolchain.cpp +++ b/src/plugins/android/androidtoolchain.cpp @@ -116,7 +116,9 @@ static void addSystemHeaderPaths(QList &paths, const Utils::FileName ndkPath = AndroidConfigurations::currentConfig().ndkLocation(); // Get short version (for example 4.9) - const QString clangVersion = version.left(version.lastIndexOf('.')); + auto versionNumber = QVersionNumber::fromString(version); + const QString clangVersion = QString("%1.%2") + .arg(versionNumber.majorVersion()).arg(versionNumber.minorVersion()); Utils::FileName stdcppPath = ndkPath; stdcppPath.appendPath("sources/cxx-stl/gnu-libstdc++/" + clangVersion); Utils::FileName includePath = stdcppPath; diff --git a/src/plugins/debugger/qml/qmlengine.cpp b/src/plugins/debugger/qml/qmlengine.cpp index fa69e81653d..b428a88ea35 100644 --- a/src/plugins/debugger/qml/qmlengine.cpp +++ b/src/plugins/debugger/qml/qmlengine.cpp @@ -2166,6 +2166,10 @@ void QmlEnginePrivate::handleFrame(const QVariantMap &response) watchHandler->insertItem(item); evaluate(exp, -1, [this, iname, exp](const QVariantMap &response) { handleEvaluateExpression(response, iname, exp); + + // If there are no scopes, "this" may be the only thing to look up. + if (currentFrameScopes.isEmpty()) + checkForFinishedUpdate(); }); } diff --git a/src/plugins/projectexplorer/devicesupport/devicecheckbuildstep.cpp b/src/plugins/projectexplorer/devicesupport/devicecheckbuildstep.cpp index 2d6164c9ae1..f90f9843c2c 100644 --- a/src/plugins/projectexplorer/devicesupport/devicecheckbuildstep.cpp +++ b/src/plugins/projectexplorer/devicesupport/devicecheckbuildstep.cpp @@ -38,7 +38,7 @@ using namespace ProjectExplorer; DeviceCheckBuildStep::DeviceCheckBuildStep(BuildStepList *bsl) : BuildStep(bsl, stepId()) { - setDefaultDisplayName(stepDisplayName()); + setDefaultDisplayName(displayName()); } bool DeviceCheckBuildStep::init(QList &earlierSteps) @@ -92,7 +92,7 @@ Core::Id DeviceCheckBuildStep::stepId() return "ProjectExplorer.DeviceCheckBuildStep"; } -QString DeviceCheckBuildStep::stepDisplayName() +QString DeviceCheckBuildStep::displayName() { return tr("Check for a configured device"); } diff --git a/src/plugins/projectexplorer/devicesupport/devicecheckbuildstep.h b/src/plugins/projectexplorer/devicesupport/devicecheckbuildstep.h index 7886a9e8abc..8a114e1e6c4 100644 --- a/src/plugins/projectexplorer/devicesupport/devicecheckbuildstep.h +++ b/src/plugins/projectexplorer/devicesupport/devicecheckbuildstep.h @@ -45,7 +45,7 @@ public: BuildStepConfigWidget *createConfigWidget() override; static Core::Id stepId(); - static QString stepDisplayName(); + static QString displayName(); }; } // namespace ProjectExplorer diff --git a/src/plugins/qnx/qnxconstants.h b/src/plugins/qnx/qnxconstants.h index f65dcf30c7e..ecd31d6b3db 100644 --- a/src/plugins/qnx/qnxconstants.h +++ b/src/plugins/qnx/qnxconstants.h @@ -39,6 +39,8 @@ const char QNX_QNX_FEATURE[] = "QtSupport.Wizards.FeatureQNX"; const char QNX_QNX_RUNCONFIGURATION_PREFIX[] = "Qt4ProjectManager.QNX.QNXRunConfiguration."; +const char QNX_QNX_DEPLOYCONFIGURATION_ID[] = "Qt4ProjectManager.QNX.QNXDeployConfiguration"; + const char QNX_QNX_OS_TYPE[] = "QnxOsType"; const char QNX_DEBUG_EXECUTABLE[] = "pdebug"; diff --git a/src/plugins/qnx/qnxdeployconfiguration.cpp b/src/plugins/qnx/qnxdeployconfiguration.cpp index 3288bb4fbca..7993a90e22a 100644 --- a/src/plugins/qnx/qnxdeployconfiguration.cpp +++ b/src/plugins/qnx/qnxdeployconfiguration.cpp @@ -60,7 +60,7 @@ NamedWidget *QnxDeployConfiguration::createConfigWidget() QnxDeployConfigurationFactory::QnxDeployConfigurationFactory() { registerDeployConfiguration - ("Qt4ProjectManager.QNX.QNXDeployConfiguration"); + (Constants::QNX_QNX_DEPLOYCONFIGURATION_ID); setDefaultDisplayName(QnxDeployConfiguration::tr("Deploy to QNX Device")); addSupportedTargetDeviceType(QnxDeviceFactory::deviceType()); } diff --git a/src/plugins/qnx/qnxplugin.cpp b/src/plugins/qnx/qnxplugin.cpp index 4bc3a7e9688..850efa48dc4 100644 --- a/src/plugins/qnx/qnxplugin.cpp +++ b/src/plugins/qnx/qnxplugin.cpp @@ -45,6 +45,7 @@ #include #include +#include #include #include #include @@ -55,6 +56,9 @@ #include #include +#include +#include + #include #include @@ -64,6 +68,19 @@ using namespace ProjectExplorer; namespace Qnx { namespace Internal { +template +class GenericQnxDeployStepFactory : public BuildStepFactory +{ +public: + GenericQnxDeployStepFactory() + { + registerStep(Step::stepId()); + setDisplayName(Step::displayName()); + setSupportedConfiguration(Constants::QNX_QNX_DEPLOYCONFIGURATION_ID); + setSupportedStepList(ProjectExplorer::Constants::BUILDSTEPS_DEPLOY); + } +}; + class QnxPluginPrivate { public: @@ -76,6 +93,9 @@ public: QnxQtVersionFactory qtVersionFactory; QnxDeviceFactory deviceFactory; QnxDeployConfigurationFactory deployConfigFactory; + GenericQnxDeployStepFactory directUploadDeployFactory; + GenericQnxDeployStepFactory checkForFreeDiskSpaceDeployFactory; + GenericQnxDeployStepFactory checkBuildDeployFactory; QnxRunConfigurationFactory runConfigFactory; QnxSettingsPage settingsPage; QnxToolChainFactory toolChainFactory;