forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/4.0' into 4.1
Conflicts: qtcreator.pri qtcreator.qbs src/plugins/android/android.qbs src/plugins/android/androiddevice.cpp src/plugins/autotest/testcodeparser.cpp src/plugins/debugger/analyzer/analyzerstartparameters.h src/plugins/projectexplorer/devicesupport/desktopdevice.cpp src/plugins/projectexplorer/devicesupport/idevice.cpp src/plugins/projectexplorer/runconfiguration.h Change-Id: I2474d06f2309fa71210a8401846bc2ef85bebf1d
This commit is contained in:
BIN
doc/images/qtcreator-custom-wizard.png
Normal file
BIN
doc/images/qtcreator-custom-wizard.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 14 KiB |
@@ -120,7 +120,7 @@
|
|||||||
\li Qt Quick Controls Application
|
\li Qt Quick Controls Application
|
||||||
|
|
||||||
Create a Qt Quick application using
|
Create a Qt Quick application using
|
||||||
\l{http://doc-snapshots.qt.io/qt5-5.7/qtquickcontrols2-index.html}
|
\l{http://doc.qt.io/qt-5/qtquickcontrols2-index.html}
|
||||||
{Qt Quick Controls 2} (requires Qt 5.7 or later),
|
{Qt Quick Controls 2} (requires Qt 5.7 or later),
|
||||||
\l{http://doc.qt.io/qt-5/qtquickcontrols-index.html}
|
\l{http://doc.qt.io/qt-5/qtquickcontrols-index.html}
|
||||||
{Qt Quick Controls}, or
|
{Qt Quick Controls}, or
|
||||||
|
@@ -37,27 +37,72 @@
|
|||||||
|
|
||||||
\title Adding JSON-Based Wizards
|
\title Adding JSON-Based Wizards
|
||||||
|
|
||||||
\image qtcreator-new-qt-gui-application.png
|
\QC searches for wizards in the shared directory and in the local user's
|
||||||
|
settings directory, as described in \l{Locating Wizards}.
|
||||||
The JSON-based wizards are displayed in the \uicontrol New dialog. To
|
|
||||||
customize them, copy a directory that contains a \c {wizard.json} file in
|
|
||||||
\c {share/qtcreator/templates/wizards/} and modify it to fit your needs.
|
|
||||||
After you run qmake and restart \QC, the wizard name appears in the
|
|
||||||
selected or added category. For each wizard, an icon, a display name, and
|
|
||||||
a description are displayed.
|
|
||||||
|
|
||||||
JSON-based wizard template directories contain a JSON configuration file
|
JSON-based wizard template directories contain a JSON configuration file
|
||||||
called \c {wizard.json} and any template files needed. The configuration
|
called \c {wizard.json} and any template files needed. The configuration
|
||||||
file contains sections that specify information about the wizard, variables
|
file contains sections that specify information about the wizard, variables
|
||||||
that you can use, wizard pages, and generators for creating files.
|
that you can use, wizard pages, and generators for creating files.
|
||||||
|
|
||||||
|
To create a customized wizard, copy a template directory to the shared
|
||||||
|
directory or the settings directory under a new name. If you want to use
|
||||||
|
qmake to build the wizard and integrate it into \QC, use the shared
|
||||||
|
directory. Otherwise, you can create a subdirectory in the settings
|
||||||
|
directory. The standard wizards are organized into subdirectories by type,
|
||||||
|
but you can add your wizard directory to any directory you like. The folder
|
||||||
|
hierarchy does not affect the order in which the wizards are displayed.
|
||||||
|
|
||||||
|
To share the wizard with other users, you can create an archive of the
|
||||||
|
wizard directory and instruct the recipients to extract it into one of the
|
||||||
|
directories \QC searches wizards from.
|
||||||
|
|
||||||
|
For wizard development, we recommend that you start \QC with the
|
||||||
|
\c {-customwizard-verbose} argument to receive confirmation that \QC was
|
||||||
|
able to find and parse the \c {wizard.json} file. The verbose mode displays
|
||||||
|
information about syntax errors, which are the most typical errors you might
|
||||||
|
run into while editing wizards. For more information, see
|
||||||
|
\l {Verbose Output}.
|
||||||
|
|
||||||
|
In addition, set keyboard shortcuts for the \uicontrol Inspect and
|
||||||
|
\uicontrol {Factory.Reset} functions to be able to inspect the fields and
|
||||||
|
variables in the wizard and to have the wizard listed in \uicontrol File >
|
||||||
|
\uicontrol {New File or Project} without restarting \QC. For more
|
||||||
|
information, see \l {Tips for Wizard Development}.
|
||||||
|
|
||||||
|
\QC displays the wizards that it finds in the
|
||||||
|
\uicontrol {New File or Project} dialog. For each wizard, an icon (1), a
|
||||||
|
display name (2), and a description (3) are displayed.
|
||||||
|
|
||||||
|
\image qtcreator-custom-wizard.png
|
||||||
|
|
||||||
|
\section1 Integrating Wizards into Qt Creator Builds
|
||||||
|
|
||||||
|
To integrate the wizard into \QC and to deliver it as part of the \QC build,
|
||||||
|
place the wizard files in the \QC sources. Then select \uicontrol Build >
|
||||||
|
\uicontrol {Run qmake}, so that the new files you added for your wizard are
|
||||||
|
actually copied from the \QC source directory into the \QC build directory
|
||||||
|
as part of the next \QC build.
|
||||||
|
|
||||||
|
If you do not run qmake, your new wizard will not show up, because it does
|
||||||
|
not exist in the build directory you run your newly built \QC from. It never
|
||||||
|
got copied there, because make did not know that the files exist in the
|
||||||
|
source tree, because qmake did not inform make that the files were added
|
||||||
|
recently.
|
||||||
|
|
||||||
|
Basically, qmake generates a fixed list of files to copy from the source
|
||||||
|
directory to the sudirectory of the build directory that is checked for
|
||||||
|
wizards at runtime. Therefore, you need to run qmake or execute the
|
||||||
|
\uicontrol {Factory.Reset} function each time the names or locations of the
|
||||||
|
files change.
|
||||||
|
|
||||||
\section1 Using Variables in Wizards
|
\section1 Using Variables in Wizards
|
||||||
|
|
||||||
You can use variables (\c {%\{<variableName>\}}) in the configuration and
|
You can use variables (\c {%\{<variableName>\}}) in the configuration and
|
||||||
template source files. A set of variables is predefined by the wizards and
|
template source files. A set of variables is predefined by the wizards and
|
||||||
their pages. You can introduce new variables as shortcuts to be used later.
|
their pages. You can introduce new variables as shortcuts to be used later.
|
||||||
Define the variable key names and values in the \c options section in the
|
Define the variable key names and values in the \c options section in the
|
||||||
\c {.json} file.
|
\c {wizard.json} file.
|
||||||
|
|
||||||
The variables always return strings. In places where a boolean value is
|
The variables always return strings. In places where a boolean value is
|
||||||
expected and a string is given, an empty string as well as the string
|
expected and a string is given, an empty string as well as the string
|
||||||
@@ -87,34 +132,45 @@
|
|||||||
use them as basis for adding your own wizards. We use the C++ wizard
|
use them as basis for adding your own wizards. We use the C++ wizard
|
||||||
to explain the process and the sections and settings in the .json file.
|
to explain the process and the sections and settings in the .json file.
|
||||||
|
|
||||||
|
In this example, we create the wizard directory in the shared directory
|
||||||
|
and integrate it in the \QC build system, so that it can deployed along with
|
||||||
|
the \QC binaries as part of the build.
|
||||||
|
|
||||||
\image qtcreator-cpp-class-wizard.png
|
\image qtcreator-cpp-class-wizard.png
|
||||||
|
|
||||||
For more information about the pages and widgets that you can add, see
|
For more information about the pages and widgets that you can add and their
|
||||||
\l {Available Pages} and \l{Available Widgets}.
|
supported properties, see \l {Available Pages} and \l{Available Widgets}.
|
||||||
|
|
||||||
To create a JSON-based C++ class wizard:
|
To create a JSON-based C++ class wizard:
|
||||||
|
|
||||||
\list 1
|
\list 1
|
||||||
|
|
||||||
\li Make a copy of \c {share/qtcreator/templates/wizards/classes/cpp}
|
\li Start \QC with the \c {-customwizard-verbose} argument to receive
|
||||||
and rename it.
|
feedback during wizard development. For more information, see
|
||||||
|
\l {Verbose Output}.
|
||||||
|
|
||||||
\li Right-click the project name in \uicontrol Projects view and
|
\li Set keyboard shortcuts for the \uicontrol Inspect and
|
||||||
select \uicontrol {Run qmake} from the context menu to register the
|
\uicontrol {Factory.Reset} actions, as described in
|
||||||
new wizard. Basically, qmake generates a fixed list of files to
|
\l {Tips for Wizard Development}.
|
||||||
copy. Therefore, you need to run qmake each time the names or
|
|
||||||
locations of the files change.
|
\li Make a copy of \c {share/qtcreator/templates/wizards/classes/cpp}
|
||||||
|
and rename it. For example,
|
||||||
|
\c {share/qtcreator/templates/wizards/classes/mycpp}
|
||||||
|
|
||||||
|
\li Use the \uicontrol {Factory.Reset} action to make the wizard appear
|
||||||
|
in \uicontrol File > \uicontrol {New File or Project} without
|
||||||
|
restarting \QC.
|
||||||
|
|
||||||
\li Open the wizard configuration file, \c {wizard.json} for editing:
|
\li Open the wizard configuration file, \c {wizard.json} for editing:
|
||||||
|
|
||||||
\list
|
\list
|
||||||
|
|
||||||
\li The following settings determine the type of the wizard and
|
\li The following settings determine the type of the wizard and
|
||||||
its place in the \uicontrol New dialog:
|
its place in the \uicontrol {New File or Project} dialog:
|
||||||
|
|
||||||
\code
|
\code
|
||||||
"version": 1,
|
"version": 1,
|
||||||
"kind": "file",
|
"supportedProjectTypes": [ ],
|
||||||
"id": "A.Class",
|
"id": "A.Class",
|
||||||
"category": "O.C++",
|
"category": "O.C++",
|
||||||
\endcode
|
\endcode
|
||||||
@@ -124,15 +180,26 @@
|
|||||||
\li \c version is the version of the file contents. Do not
|
\li \c version is the version of the file contents. Do not
|
||||||
modify this value.
|
modify this value.
|
||||||
|
|
||||||
\li \c kind specifies the type of the wizard: \c file or
|
\li \c supportedProjectTypes is an optional setting that
|
||||||
\c project.
|
can be used to filter wizards when adding a new build
|
||||||
|
target to an existing project. For example, only wizards
|
||||||
|
that produce qmake projects should be provided when
|
||||||
|
adding a new target to an existing qmake project.
|
||||||
|
|
||||||
This information is available in the wizard as
|
Possible values are the build systems supported by \QC
|
||||||
\c {%\{kind\}} with values \c file or \c project.
|
or \c UNKNOWN_PROJECT if the build system is not
|
||||||
|
specified: \c AutotoolsProjectManager.AutotoolsProject,
|
||||||
|
\c CMakeProjectManager.CMakeProject,
|
||||||
|
\c GenericProjectManager.GenericProject,
|
||||||
|
\c PythonProject, \c Qbs.QbsProject,
|
||||||
|
\c Qt4ProjectManager.Qt4Project (qmake project),
|
||||||
|
\c QmlProjectManager.QmlProject
|
||||||
|
|
||||||
\li \c id is the unique identifier for your wizard. You can
|
\li \c id is the unique identifier for your wizard. Wizards
|
||||||
use a leading letter to specify the position of the
|
are sorted by the ID in alphabetic order within the
|
||||||
wizard within the \c category.
|
\c category. You can use a leading letter to specify the
|
||||||
|
position of the wizard. You must always change
|
||||||
|
this value. For example, \c B.MyClass.
|
||||||
|
|
||||||
This information is available in the wizard as
|
This information is available in the wizard as
|
||||||
\c {%\{id\}}.
|
\c {%\{id\}}.
|
||||||
@@ -140,20 +207,21 @@
|
|||||||
\li \c category is the category in which to place the wizard
|
\li \c category is the category in which to place the wizard
|
||||||
in the list. You can use a leading letter to specify the
|
in the list. You can use a leading letter to specify the
|
||||||
position of the category in the list in the
|
position of the category in the list in the
|
||||||
\uicontrol New dialog.
|
\uicontrol {New File or Project} dialog.
|
||||||
|
|
||||||
This information is available in the wizard as
|
This information is available in the wizard as
|
||||||
\c {%\{category\}}.
|
\c {%\{category\}}.
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
\li The following settings specify the icon and text that appear in
|
\li The following settings specify the icon and text that appear in
|
||||||
the \uicontrol New dialog:
|
the \uicontrol {New File or Project} dialog:
|
||||||
|
|
||||||
\code
|
\code
|
||||||
"trDescription": "Creates a C++ header and a source file for a new class that you can add to a C++ project.",
|
"trDescription": "Creates a C++ header and a source file for a new class that you can add to a C++ project.",
|
||||||
"trDisplayName": "C++ Class",
|
"trDisplayName": "C++ Class",
|
||||||
"trDisplayCategory": "C++",
|
"trDisplayCategory": "C++",
|
||||||
"icon": "../../global/genericfilewizard.png",
|
"icon": "../../global/genericfilewizard.png",
|
||||||
|
"enabled": "%{JS: [ %{Plugins} ].indexOf('CppEditor') >= 0}",
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
\list
|
\list
|
||||||
@@ -170,8 +238,9 @@
|
|||||||
This information is available in the wizard as
|
This information is available in the wizard as
|
||||||
\c {%\{trDisplayName\}}.
|
\c {%\{trDisplayName\}}.
|
||||||
|
|
||||||
\li \c trDisplayCategory appears in the \uicontrol New dialog,
|
\li \c trDisplayCategory appears in the
|
||||||
under \uicontrol Projects.
|
\uicontrol {New File or Project} dialog, under
|
||||||
|
\uicontrol Projects.
|
||||||
|
|
||||||
This information is available in the wizard as
|
This information is available in the wizard as
|
||||||
\c {%\{trDisplayCategory\}}.
|
\c {%\{trDisplayCategory\}}.
|
||||||
@@ -580,6 +649,9 @@
|
|||||||
\li Text Edit
|
\li Text Edit
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
|
\note Only the the settings documented in the following sections are
|
||||||
|
supported in wizards.
|
||||||
|
|
||||||
Specify the following settings for each widget:
|
Specify the following settings for each widget:
|
||||||
|
|
||||||
\list
|
\list
|
||||||
|
@@ -78,7 +78,7 @@
|
|||||||
\li the local user's configuration folder,
|
\li the local user's configuration folder,
|
||||||
\c {$HOME/.config/QtProject/qtcreator/templates/wizards} on Linux
|
\c {$HOME/.config/QtProject/qtcreator/templates/wizards} on Linux
|
||||||
and OS X or \c {%APPDATA%\QtProject\qtcreator\templates\wizards} on
|
and OS X or \c {%APPDATA%\QtProject\qtcreator\templates\wizards} on
|
||||||
windows
|
Windows
|
||||||
|
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
@@ -114,9 +114,34 @@
|
|||||||
a wizard definition to become visible.
|
a wizard definition to become visible.
|
||||||
\endtable
|
\endtable
|
||||||
|
|
||||||
\note When developing custom wizards (both JSON as well as XML based), it is
|
\section2 Verbose Output
|
||||||
recommended to start \QC with the \c {-customwizard-verbose} argument. See
|
|
||||||
\l{Using Command Line Options} for more information about command line
|
|
||||||
arguments.
|
|
||||||
|
|
||||||
|
When developing custom wizards (both JSON as well as XML based), it is
|
||||||
|
recommended to start \QC with the \c {-customwizard-verbose} argument. It
|
||||||
|
causes each correctly set up wizard to produce output along the following
|
||||||
|
lines:
|
||||||
|
|
||||||
|
\code
|
||||||
|
Checking "/home/jsmith/.config/QtProject/qtcreator/templates/wizards/mywizard"
|
||||||
|
for wizard.json.
|
||||||
|
* Configuration found and parsed.
|
||||||
|
\endcode
|
||||||
|
|
||||||
|
The output includes the name of the directory that was checked for a
|
||||||
|
\c wizard.json file. If the file is not found, the message is not displayed.
|
||||||
|
|
||||||
|
If the file contains errors, such as an invalid icon path, the following
|
||||||
|
types of messages are displayed:
|
||||||
|
|
||||||
|
\code
|
||||||
|
Checking "/home/jsmith/.config/QtProject/qtcreator/templates/wizards/mywizard"
|
||||||
|
for wizard.json.
|
||||||
|
* Configuration found and parsed.
|
||||||
|
* Failed to create: Icon file
|
||||||
|
"/home/jsmith/.config/QtProject/qtcreator/templates/wizards/mywizard/../..
|
||||||
|
/global/genericfilewizard.png" not found.
|
||||||
|
\endcode
|
||||||
|
|
||||||
|
See \l{Using Command Line Options} for more information about command line
|
||||||
|
arguments.
|
||||||
*/
|
*/
|
||||||
|
@@ -54,7 +54,7 @@
|
|||||||
\uicontrol {Qt Quick Controls 2 Application}, and
|
\uicontrol {Qt Quick Controls 2 Application}, and
|
||||||
\uicontrol {Qt Labs Controls Application} are like
|
\uicontrol {Qt Labs Controls Application} are like
|
||||||
\uicontrol {Qt Quick Application}, but using
|
\uicontrol {Qt Quick Application}, but using
|
||||||
\l{http://doc-snapshots.qt.io/qt5-5.7/qtquickcontrols2-index.html}
|
\l{http://doc.qt.io/qt-5/qtquickcontrols2-index.html}
|
||||||
{Qt Quick Controls 2} (requires Qt 5.7 or later),
|
{Qt Quick Controls 2} (requires Qt 5.7 or later),
|
||||||
\l{http://doc.qt.io/qt-5/qtquickcontrols-index.html}
|
\l{http://doc.qt.io/qt-5/qtquickcontrols-index.html}
|
||||||
{Qt Quick Controls}, or
|
{Qt Quick Controls}, or
|
||||||
|
@@ -207,9 +207,8 @@ bool FileUtils::isFileNewerThan(const FileName &filePath, const QDateTime &timeS
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Recursively resolves possibly present symlinks in \a filePath.
|
Recursively resolves symlinks if \a filePath is a symlink.
|
||||||
Unlike QFileInfo::canonicalFilePath(), this function will still return the expected target file
|
To resolve symlinks anywhere in the path, see canonicalPath
|
||||||
even if the symlink is dangling.
|
|
||||||
|
|
||||||
\note Maximum recursion depth == 16.
|
\note Maximum recursion depth == 16.
|
||||||
|
|
||||||
@@ -226,6 +225,21 @@ FileName FileUtils::resolveSymlinks(const FileName &path)
|
|||||||
return FileName::fromString(f.filePath());
|
return FileName::fromString(f.filePath());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Recursively resolves possibly present symlinks in \a filePath.
|
||||||
|
Unlike QFileInfo::canonicalFilePath(), this function will not return an empty
|
||||||
|
string if path doesn't exist.
|
||||||
|
|
||||||
|
Returns the canonical path.
|
||||||
|
*/
|
||||||
|
FileName FileUtils::canonicalPath(const FileName &path)
|
||||||
|
{
|
||||||
|
const QString result = QFileInfo(path.toString()).canonicalFilePath();
|
||||||
|
if (result.isEmpty())
|
||||||
|
return path;
|
||||||
|
return FileName::fromString(result);
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Like QDir::toNativeSeparators(), but use prefix '~' instead of $HOME on unix systems when an
|
Like QDir::toNativeSeparators(), but use prefix '~' instead of $HOME on unix systems when an
|
||||||
absolute path is given.
|
absolute path is given.
|
||||||
|
@@ -108,6 +108,7 @@ public:
|
|||||||
QString *error = 0, const std::function<bool (QFileInfo, QFileInfo, QString *)> ©Helper = std::function<bool (QFileInfo, QFileInfo, QString *)>());
|
QString *error = 0, const std::function<bool (QFileInfo, QFileInfo, QString *)> ©Helper = std::function<bool (QFileInfo, QFileInfo, QString *)>());
|
||||||
static bool isFileNewerThan(const FileName &filePath, const QDateTime &timeStamp);
|
static bool isFileNewerThan(const FileName &filePath, const QDateTime &timeStamp);
|
||||||
static FileName resolveSymlinks(const FileName &path);
|
static FileName resolveSymlinks(const FileName &path);
|
||||||
|
static FileName canonicalPath(const FileName &path);
|
||||||
static QString shortNativePath(const FileName &path);
|
static QString shortNativePath(const FileName &path);
|
||||||
static QString fileSystemFriendlyName(const QString &name);
|
static QString fileSystemFriendlyName(const QString &name);
|
||||||
static int indexOfQmakeUnfriendly(const QString &name, int startpos = 0);
|
static int indexOfQmakeUnfriendly(const QString &name, int startpos = 0);
|
||||||
|
@@ -87,7 +87,8 @@ SOURCES += \
|
|||||||
avddialog.cpp \
|
avddialog.cpp \
|
||||||
androidbuildapkstep.cpp \
|
androidbuildapkstep.cpp \
|
||||||
androidbuildapkwidget.cpp \
|
androidbuildapkwidget.cpp \
|
||||||
androidqtsupport.cpp
|
androidqtsupport.cpp \
|
||||||
|
androidrunnable.cpp
|
||||||
|
|
||||||
FORMS += \
|
FORMS += \
|
||||||
androidsettingswidget.ui \
|
androidsettingswidget.ui \
|
||||||
|
@@ -80,6 +80,7 @@ Project {
|
|||||||
"androidruncontrol.h",
|
"androidruncontrol.h",
|
||||||
"androidrunfactories.cpp",
|
"androidrunfactories.cpp",
|
||||||
"androidrunfactories.h",
|
"androidrunfactories.h",
|
||||||
|
"androidrunnable.cpp",
|
||||||
"androidrunnable.h",
|
"androidrunnable.h",
|
||||||
"androidrunner.cpp",
|
"androidrunner.cpp",
|
||||||
"androidrunner.h",
|
"androidrunner.h",
|
||||||
|
@@ -28,6 +28,7 @@
|
|||||||
#include "androidsignaloperation.h"
|
#include "androidsignaloperation.h"
|
||||||
|
|
||||||
#include <projectexplorer/runconfiguration.h>
|
#include <projectexplorer/runconfiguration.h>
|
||||||
|
#include <projectexplorer/runnables.h>
|
||||||
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
|
|
||||||
|
32
src/plugins/android/androidrunnable.cpp
Normal file
32
src/plugins/android/androidrunnable.cpp
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2016 The Qt Company Ltd.
|
||||||
|
** Contact: https://www.qt.io/licensing/
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator.
|
||||||
|
**
|
||||||
|
** Commercial License Usage
|
||||||
|
** Licensees holding valid commercial Qt licenses may use this file in
|
||||||
|
** accordance with the commercial license agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and The Qt Company. For licensing terms
|
||||||
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||||
|
** information use the contact form at https://www.qt.io/contact-us.
|
||||||
|
**
|
||||||
|
** GNU General Public License Usage
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU
|
||||||
|
** General Public License version 3 as published by the Free Software
|
||||||
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||||
|
** included in the packaging of this file. Please review the following
|
||||||
|
** information to ensure the GNU General Public License requirements will
|
||||||
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include "androidrunnable.h"
|
||||||
|
|
||||||
|
namespace Android {
|
||||||
|
|
||||||
|
void *AndroidRunnable::staticTypeId = &AndroidRunnable::staticTypeId;
|
||||||
|
|
||||||
|
} // namespace Android
|
@@ -39,6 +39,8 @@ struct ANDROID_EXPORT AndroidRunnable
|
|||||||
QVector<QStringList> beforeStartADBCommands;
|
QVector<QStringList> beforeStartADBCommands;
|
||||||
QVector<QStringList> afterFinishADBCommands;
|
QVector<QStringList> afterFinishADBCommands;
|
||||||
QString deviceSerialNumber;
|
QString deviceSerialNumber;
|
||||||
|
|
||||||
|
static void *staticTypeId;
|
||||||
};
|
};
|
||||||
|
|
||||||
inline bool operator==(const AndroidRunnable &r1, const AndroidRunnable &r2)
|
inline bool operator==(const AndroidRunnable &r1, const AndroidRunnable &r2)
|
||||||
|
@@ -289,8 +289,12 @@ CMakeConfig BuildDirManager::parsedConfiguration() const
|
|||||||
emit errorOccured(errorMessage);
|
emit errorOccured(errorMessage);
|
||||||
const Utils::FileName sourceOfBuildDir
|
const Utils::FileName sourceOfBuildDir
|
||||||
= Utils::FileName::fromUtf8(CMakeConfigItem::valueOf("CMAKE_HOME_DIRECTORY", m_cmakeCache));
|
= Utils::FileName::fromUtf8(CMakeConfigItem::valueOf("CMAKE_HOME_DIRECTORY", m_cmakeCache));
|
||||||
if (sourceOfBuildDir != sourceDirectory()) // Use case-insensitive compare where appropriate
|
const Utils::FileName canonicalSourceOfBuildDir = Utils::FileUtils::canonicalPath(sourceOfBuildDir);
|
||||||
emit errorOccured(tr("The build directory is not for %1").arg(sourceDirectory().toUserOutput()));
|
const Utils::FileName canonicalSourceDirectory = Utils::FileUtils::canonicalPath(sourceDirectory());
|
||||||
|
if (canonicalSourceOfBuildDir != canonicalSourceDirectory) // Uses case-insensitive compare where appropriate
|
||||||
|
emit errorOccured(tr("The build directory is not for %1 but for %2")
|
||||||
|
.arg(canonicalSourceOfBuildDir.toUserOutput(),
|
||||||
|
canonicalSourceDirectory.toUserOutput()));
|
||||||
}
|
}
|
||||||
return m_cmakeCache;
|
return m_cmakeCache;
|
||||||
}
|
}
|
||||||
|
@@ -39,6 +39,8 @@ public:
|
|||||||
QString analyzerHost;
|
QString analyzerHost;
|
||||||
QString analyzerSocket;
|
QString analyzerSocket;
|
||||||
Utils::Port analyzerPort;
|
Utils::Port analyzerPort;
|
||||||
|
|
||||||
|
static void *staticTypeId;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Debugger
|
} // namespace Debugger
|
||||||
|
@@ -3849,6 +3849,9 @@ QList<QObject *> DebuggerPlugin::createTestObjects() const
|
|||||||
#endif // if WITH_TESTS
|
#endif // if WITH_TESTS
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|
||||||
|
void *AnalyzerConnection::staticTypeId = &AnalyzerConnection::staticTypeId;
|
||||||
|
|
||||||
} // namespace Debugger
|
} // namespace Debugger
|
||||||
|
|
||||||
#include "debuggerplugin.moc"
|
#include "debuggerplugin.moc"
|
||||||
|
@@ -28,8 +28,9 @@
|
|||||||
#include "customwizardpage.h"
|
#include "customwizardpage.h"
|
||||||
#include "customwizardscriptgenerator.h"
|
#include "customwizardscriptgenerator.h"
|
||||||
|
|
||||||
#include <projectexplorer/projectexplorer.h>
|
|
||||||
#include <projectexplorer/baseprojectwizarddialog.h>
|
#include <projectexplorer/baseprojectwizarddialog.h>
|
||||||
|
#include <projectexplorer/projectexplorer.h>
|
||||||
|
#include <projectexplorer/runconfiguration.h>
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/messagemanager.h>
|
#include <coreplugin/messagemanager.h>
|
||||||
|
@@ -32,6 +32,7 @@
|
|||||||
|
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
#include <projectexplorer/runconfiguration.h>
|
#include <projectexplorer/runconfiguration.h>
|
||||||
|
#include <projectexplorer/runnables.h>
|
||||||
|
|
||||||
#include <ssh/sshconnection.h>
|
#include <ssh/sshconnection.h>
|
||||||
|
|
||||||
|
@@ -31,6 +31,7 @@
|
|||||||
#include "../kit.h"
|
#include "../kit.h"
|
||||||
#include "../kitinformation.h"
|
#include "../kitinformation.h"
|
||||||
#include "../runconfiguration.h"
|
#include "../runconfiguration.h"
|
||||||
|
#include "../runnables.h"
|
||||||
|
|
||||||
#include <ssh/sshconnection.h>
|
#include <ssh/sshconnection.h>
|
||||||
#include <utils/portlist.h>
|
#include <utils/portlist.h>
|
||||||
@@ -467,4 +468,6 @@ DeviceEnvironmentFetcher::DeviceEnvironmentFetcher()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void *HostName::staticTypeId = &HostName::staticTypeId;
|
||||||
|
|
||||||
} // namespace ProjectExplorer
|
} // namespace ProjectExplorer
|
||||||
|
@@ -108,16 +108,6 @@ public:
|
|||||||
virtual QList<Utils::Port> usedPorts(const QByteArray &commandOutput) const = 0;
|
virtual QList<Utils::Port> usedPorts(const QByteArray &commandOutput) const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
class PROJECTEXPLORER_EXPORT HostName
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
explicit HostName(const QString &host) : m_host(host) {}
|
|
||||||
QString host() const { return m_host; }
|
|
||||||
|
|
||||||
private:
|
|
||||||
QString m_host;
|
|
||||||
};
|
|
||||||
|
|
||||||
// See cpp file for documentation.
|
// See cpp file for documentation.
|
||||||
class PROJECTEXPLORER_EXPORT IDevice
|
class PROJECTEXPLORER_EXPORT IDevice
|
||||||
{
|
{
|
||||||
|
@@ -161,6 +161,7 @@ class PROJECTEXPLORER_EXPORT Runnable
|
|||||||
virtual ~Concept() {}
|
virtual ~Concept() {}
|
||||||
virtual Concept *clone() const = 0;
|
virtual Concept *clone() const = 0;
|
||||||
virtual bool canReUseOutputPane(const std::unique_ptr<Concept> &other) const = 0;
|
virtual bool canReUseOutputPane(const std::unique_ptr<Concept> &other) const = 0;
|
||||||
|
virtual void *typeId() const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
@@ -172,10 +173,14 @@ class PROJECTEXPLORER_EXPORT Runnable
|
|||||||
|
|
||||||
bool canReUseOutputPane(const std::unique_ptr<Concept> &other) const override
|
bool canReUseOutputPane(const std::unique_ptr<Concept> &other) const override
|
||||||
{
|
{
|
||||||
auto that = dynamic_cast<const Model<T> *>(other.get());
|
if (other->typeId() != typeId())
|
||||||
return that && m_data == that->m_data;
|
return false;
|
||||||
|
auto that = static_cast<const Model<T> *>(other.get());
|
||||||
|
return m_data == that->m_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void *typeId() const { return T::staticTypeId; }
|
||||||
|
|
||||||
T m_data;
|
T m_data;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -187,8 +192,13 @@ public:
|
|||||||
|
|
||||||
void operator=(Runnable other) { d = std::move(other.d); }
|
void operator=(Runnable other) { d = std::move(other.d); }
|
||||||
|
|
||||||
template <class T> bool is() const { return dynamic_cast<Model<T> *>(d.get()) != 0; }
|
template <class T> bool is() const {
|
||||||
template <class T> const T &as() const { return static_cast<Model<T> *>(d.get())->m_data; }
|
return d.get()->typeId() == T::staticTypeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class T> const T &as() const {
|
||||||
|
return static_cast<Model<T> *>(d.get())->m_data;
|
||||||
|
}
|
||||||
|
|
||||||
bool canReUseOutputPane(const Runnable &other) const;
|
bool canReUseOutputPane(const Runnable &other) const;
|
||||||
|
|
||||||
@@ -202,6 +212,7 @@ class PROJECTEXPLORER_EXPORT Connection
|
|||||||
{
|
{
|
||||||
virtual ~Concept() {}
|
virtual ~Concept() {}
|
||||||
virtual Concept *clone() const = 0;
|
virtual Concept *clone() const = 0;
|
||||||
|
virtual void *typeId() const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
@@ -209,6 +220,7 @@ class PROJECTEXPLORER_EXPORT Connection
|
|||||||
{
|
{
|
||||||
Model(const T &data) : m_data(data) { }
|
Model(const T &data) : m_data(data) { }
|
||||||
Concept *clone() const override { return new Model(*this); }
|
Concept *clone() const override { return new Model(*this); }
|
||||||
|
void *typeId() const { return T::staticTypeId; }
|
||||||
T m_data;
|
T m_data;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -220,8 +232,13 @@ public:
|
|||||||
|
|
||||||
void operator=(Connection other) { d = std::move(other.d); }
|
void operator=(Connection other) { d = std::move(other.d); }
|
||||||
|
|
||||||
template <class T> bool is() const { return dynamic_cast<Model<T> *>(d.get()) != 0; }
|
template <class T> bool is() const {
|
||||||
template <class T> const T &as() const { return static_cast<Model<T> *>(d.get())->m_data; }
|
return d.get()->typeId() == T::staticTypeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class T> const T &as() const {
|
||||||
|
return static_cast<Model<T> *>(d.get())->m_data;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::unique_ptr<Concept> d;
|
std::unique_ptr<Concept> d;
|
||||||
|
@@ -35,4 +35,6 @@ bool operator==(const StandardRunnable &r1, const StandardRunnable &r2)
|
|||||||
&& r1.environment == r2.environment;
|
&& r1.environment == r2.environment;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void *StandardRunnable::staticTypeId = &StandardRunnable::staticTypeId;
|
||||||
|
|
||||||
} // namespace ProjectExplorer
|
} // namespace ProjectExplorer
|
||||||
|
@@ -43,8 +43,22 @@ public:
|
|||||||
Utils::Environment environment;
|
Utils::Environment environment;
|
||||||
ApplicationLauncher::Mode runMode = ApplicationLauncher::Gui;
|
ApplicationLauncher::Mode runMode = ApplicationLauncher::Gui;
|
||||||
IDevice::ConstPtr device; // Override the kit's device. Keep unset by default.
|
IDevice::ConstPtr device; // Override the kit's device. Keep unset by default.
|
||||||
|
|
||||||
|
static void *staticTypeId;
|
||||||
};
|
};
|
||||||
|
|
||||||
PROJECTEXPLORER_EXPORT bool operator==(const StandardRunnable &r1, const StandardRunnable &r2);
|
PROJECTEXPLORER_EXPORT bool operator==(const StandardRunnable &r1, const StandardRunnable &r2);
|
||||||
|
|
||||||
|
class PROJECTEXPLORER_EXPORT HostName
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit HostName(const QString &host) : m_host(host) {}
|
||||||
|
QString host() const { return m_host; }
|
||||||
|
|
||||||
|
static void *staticTypeId;
|
||||||
|
|
||||||
|
private:
|
||||||
|
QString m_host;
|
||||||
|
};
|
||||||
|
|
||||||
} // namespace ProjectExplorer
|
} // namespace ProjectExplorer
|
||||||
|
@@ -89,7 +89,7 @@ static QStringList targetOSList(const ProjectExplorer::Abi &abi, const ProjectEx
|
|||||||
break;
|
break;
|
||||||
case ProjectExplorer::Abi::MacOS:
|
case ProjectExplorer::Abi::MacOS:
|
||||||
if (device == DESKTOP_DEVICE_TYPE)
|
if (device == DESKTOP_DEVICE_TYPE)
|
||||||
os << QLatin1String("osx");
|
os << QLatin1String("macos") << QLatin1String("osx");
|
||||||
else if (device == IOS_DEVICE_TYPE)
|
else if (device == IOS_DEVICE_TYPE)
|
||||||
os << QLatin1String("ios");
|
os << QLatin1String("ios");
|
||||||
else if (device == IOS_SIMULATOR_TYPE)
|
else if (device == IOS_SIMULATOR_TYPE)
|
||||||
|
@@ -47,6 +47,8 @@
|
|||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
#include "gtest-qt-printing.h"
|
#include "gtest-qt-printing.h"
|
||||||
|
|
||||||
|
#include <utils/hostosinfo.h>
|
||||||
|
|
||||||
#include <QBuffer>
|
#include <QBuffer>
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
#include <QSignalSpy>
|
#include <QSignalSpy>
|
||||||
@@ -55,12 +57,6 @@
|
|||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
|
||||||
#define QTC_HOST_EXE_SUFFIX L".exe"
|
|
||||||
#else
|
|
||||||
#define QTC_HOST_EXE_SUFFIX ""
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace ClangBackEnd;
|
using namespace ClangBackEnd;
|
||||||
|
|
||||||
using ::testing::Eq;
|
using ::testing::Eq;
|
||||||
@@ -175,7 +171,7 @@ TEST_F(ClientServerOutsideProcess, SendUnregisterProjectPartsForEditorMessage)
|
|||||||
|
|
||||||
void ClientServerOutsideProcess::SetUpTestCase()
|
void ClientServerOutsideProcess::SetUpTestCase()
|
||||||
{
|
{
|
||||||
client.setProcessPath(QStringLiteral(ECHOSERVER QTC_HOST_EXE_SUFFIX));
|
client.setProcessPath(Utils::HostOsInfo::withExecutableSuffix(QStringLiteral(ECHOSERVER)));
|
||||||
|
|
||||||
ASSERT_TRUE(client.connectToServer());
|
ASSERT_TRUE(client.connectToServer());
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user