diff options
author | Katja Marttila <katja.marttila@qt.io> | 2018-01-12 10:43:29 +0200 |
---|---|---|
committer | Katja Marttila <katja.marttila@qt.io> | 2018-02-12 11:53:34 +0000 |
commit | c0b2007d2002055f92f3c7dea2e5df55bd40b2c6 (patch) | |
tree | 2b33d32b9c3a04ea38c36e68c543f37243a6ac94 /src | |
parent | 0dd63d2e9a3f32fa8c16e31a01f5b897453ee9e5 (diff) |
Enable building IFW with Squish support
Change enables building IFW with Squish support by passing SQUISH_PATH
to qmake when building IFW. Also enables runtime change of Squish port
with command line option --squish-port <port number>. If no port is set,
default port 11233 is used to attach to Squish.
Change-Id: I4821b360031df66968d3592886c2e45598e1b097
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
Reviewed-by: Antti Kokko <antti.kokko@qt.io>
Reviewed-by: Johanna Äijälä <johanna.aijala@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/sdk/commandlineparser.cpp | 6 | ||||
-rw-r--r-- | src/sdk/constants.h | 1 | ||||
-rw-r--r-- | src/sdk/installerbase.cpp | 18 | ||||
-rw-r--r-- | src/sdk/sdk.pro | 5 |
4 files changed, 30 insertions, 0 deletions
diff --git a/src/sdk/commandlineparser.cpp b/src/sdk/commandlineparser.cpp index 2f1568786..80aa0afa8 100644 --- a/src/sdk/commandlineparser.cpp +++ b/src/sdk/commandlineparser.cpp @@ -122,4 +122,10 @@ CommandLineParser::CommandLineParser() QLatin1String("Use the specified platform plugin."), QLatin1String("plugin"))); m_parser.addPositionalArgument(QLatin1String(CommandLineOptions::KeyValue), QLatin1String("Key Value pair to be set.")); + m_parser.addOption(QCommandLineOption(QLatin1String(CommandLineOptions::SquishPort), + QLatin1String("Give a port where Squish can connect to. If no port is given, default " + "port 11233 is used. Note: To enable Squish support you first need to build IFW with " + "SQUISH_PATH parameter where SQUISH_PATH is pointing to your Squish installation folder: " + "<path_to_qt>/bin/qmake -r SQUISH_PATH=<pat_to_squish>"), + QLatin1String("port number"))); } diff --git a/src/sdk/constants.h b/src/sdk/constants.h index d46af2db4..e9eca9103 100644 --- a/src/sdk/constants.h +++ b/src/sdk/constants.h @@ -55,6 +55,7 @@ const char StartClient[] = "startclient"; const char InstallCompressedRepository[] = "installCompressedRepository"; const char SilentUpdate[] = "silentUpdate"; const char Platform[] = "platform"; +const char SquishPort[] = "squish-port"; } // namespace CommandLineOptions diff --git a/src/sdk/installerbase.cpp b/src/sdk/installerbase.cpp index 6004d286e..5d5028be1 100644 --- a/src/sdk/installerbase.cpp +++ b/src/sdk/installerbase.cpp @@ -58,6 +58,10 @@ #include <QUuid> #include <QLoggingCategory> +#ifdef ENABLE_SQUISH +#include <qtbuiltinhook.h> +#endif + InstallerBase::InstallerBase(int &argc, char *argv[]) : SDKApp<QApplication>(argc, argv) , m_core(0) @@ -321,6 +325,20 @@ int InstallerBase::run() if (status != QInstaller::PackageManagerCore::Success) return status; +#ifdef ENABLE_SQUISH + int squishPort = 11233; + if (parser.isSet(QLatin1String(CommandLineOptions::SquishPort))) { + squishPort = parser.value(QLatin1String(CommandLineOptions::SquishPort)).toInt(); + } + if (squishPort != 0) { + if (Squish::allowAttaching(squishPort)) + qDebug() << "Attaching to squish port " << squishPort << " succeeded"; + else + qDebug() << "Attaching to squish failed."; + } else { + qWarning() << "Invalid squish port number: " << squishPort; + } +#endif const int result = QCoreApplication::instance()->exec(); if (result != 0) return result; diff --git a/src/sdk/sdk.pro b/src/sdk/sdk.pro index 677f187a7..ac84dd66e 100644 --- a/src/sdk/sdk.pro +++ b/src/sdk/sdk.pro @@ -4,6 +4,11 @@ TARGET = installerbase include(../../installerfw.pri) +!isEmpty(SQUISH_PATH) { + DEFINES += ENABLE_SQUISH + include($$SQUISH_PATH/qtbuiltinhook.pri) +} + QT += network qml xml widgets # add the minimal plugin in static build to be able to start the installer headless with: # installer-binary --platform minimal |