Commit Graph

24 Commits

Author SHA1 Message Date
hjk
1874906ce1 Utils: Make CommandLine related operators hidden friends
Change-Id: Ifb81bb565f7343739883c06817f3e304bdc5b963
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-06 12:54:25 +00:00
Kai Köhne
56baf8c058 Remove GPL-3.0+ from license identifiers
Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0,
this applies only to a hypothetical newer version of GPL, that doesn't
exist yet. If such a version emerges, we can still decide to relicense...

While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only

Change was done by running

  find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \;

Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-06 11:15:13 +00:00
Marcus Tillmanns
fd829240ed Utils: Fix addCommandLineWithAnd for Windows
Also enable more unittests on windows

Change-Id: I241b77c640949cf622dc8138991036bb066ce3cf
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2022-11-30 08:02:53 +00:00
Marcus Tillmanns
3e6c3d9fe7 Utils: Add "addCommandLine..." functions
addCommandLineAsSingleArg allows to reliably create commandlines
like "bash -c 'echo ...'"

addCommandLineWithAnd combines two command lines
by adding '&&' in between

Change-Id: Ic5af34c90fd5271dced40ba1341a3df019ededb8
Reviewed-by: hjk <hjk@qt.io>
2022-11-22 13:17:00 +00:00
hjk
33ea6f2433 Utils: Don't resolve relative paths in ProcessArgs::prepareCommand
Part of an attempt to disentangle streamline environment creation/setup.

Searching is expensive and needs currently the proper environment.

Change-Id: I95d93abf6c0cedeb8ba0b7a447345cd033ac2f25
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-11-21 12:17:47 +00:00
Marcus Tillmanns
9498b736da Utils: Allow Os Type selection for CommandLine
Adds function overloads allowing users to choose the flavor of
command line argument quoting.

Change-Id: I24518162c286114333a93301fedc2a3329cd0c29
Reviewed-by: hjk <hjk@qt.io>
2022-10-18 08:48:47 +00:00
Eike Ziller
e77c90469b Utils: Use qtcEnvironmentVariable* instead of qEnvironmentVariable*
And instead of qgetenv.
Takes Qt Creator's setting at "Environment > System > Environment" into
account, which makes it easier on some platforms to set them (e.g.
macOS), can be configured differently in different settings paths, and
potentially can be changed at runtime (depending on usage).

Change-Id: I50e457bab2d3495e5c69676fe1a0257a5fea3e52
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2022-09-01 13:03:05 +00:00
Lucie Gérard
a7956df3ca Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.

Task-number: QTBUG-67283
Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-08-26 12:27:18 +00:00
hjk
31f0ba4ef9 Utils: Introduce FilePath::displayName()
To produce "<filepath> on <devicename>" which is nicer to read than
"<scheme>://<deviceid>/<filepath>" in some places.

Change-Id: Ife47bbf49382cf73dd4709d826bdeaa8730f88be
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-06-02 15:14:27 +00:00
hjk
ae42604904 Utils: Add CommandLine::prependArgs convenience functions
For clearer code on the user side.

Change-Id: I3adf2e96628f4e59293cd2f0966fb30989e0da9f
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-05-25 10:26:46 +00:00
Jarek Kobus
c31285d317 GenericLinuxDeviceTester: Use FileTransfer for sftp and rsync
Make ProcessArgs::prepareCommand() return false in case
when executable is a relative path and it can't be found.

Amends 13067a7d9c

Change-Id: I0c4cf1580be34894df01245eb2411cdd7a122651
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-05-20 09:19:59 +00:00
Robert Löhning
7c942cfd18 Remove outdated code
Change-Id: I65e0ed79dabd987bc67d4082969835d52dd7cb8b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-03-09 18:53:36 +00:00
hjk
95c9579c58 ProjectExplorer: Normalize DeviceProcess::start() signature
Change-Id: I2915be34d4a1eed64567874dcf0263b7583cc142
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-02-14 15:10:12 +00:00
Christian Stenger
93d67dd6ac Utils: Fix missing include
Amends 5967dd52ed.

Change-Id: I0fe1f8f9967eac679c32c9e6288249f8a0c575ae
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-11-18 05:45:13 +00:00
Jarek Kobus
5967dd52ed CommandLine: implement debug streaming operator
Change-Id: I09a47d70d5bea315efa1af505f7afc69c8075310
Reviewed-by: hjk <hjk@qt.io>
2021-11-17 10:48:45 +00:00
Orgad Shaneh
13067a7d9c CommandLine: Find executable in PATH when it is relative
Task-number: QTCREATORBUG-26329
Change-Id: Ie7b30ea5c73d11e4a9961bdaa732ee36e0e377e7
Reviewed-by: hjk <hjk@qt.io>
2021-09-30 07:04:33 +00:00
hjk
d119c717c1 Core: Use Utils::CommandLine in ExecuteFilter
... using a new CommandLine::fromUserInput convenience function.

Change-Id: Ic786530af89ec80f4211e66f36caa22cb705effe
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-08-24 07:53:29 +00:00
hjk
20a63d6c7e Utils: Drop OsType parameter from CommandLine functions
The type is implicitly given by the command's executble FilePath.

Also, rename the rarely used addArgs(const CommandLine &) overload
to addCommandLineAsArgs() and make it strip scheme and host from
the wrapped executable as there are no uses expected where keeping
them would be the right thing.

Change-Id: Id0b76778e7e01ac16e477f36bf30bb28d96bb177
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-24 07:36:04 +00:00
hjk
7c28c4f744 Utils: Introduce a FilePath constructor from char arrays
Similar to QT_RESTRICTED_CAST_FROM_ASCII to avoid the need for
decorations in user code.

At the same time, drop some convenience constructors and functions
in CommandLine and Icon essentially serving the same purpose.

Change-Id: Ida4e5ac19c2da0a4298a97b2a8e1511d56bbb79d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-17 05:34:10 +00:00
hjk
c3077fde55 Utils: Rename cmd parameter to args in prepareArgs
That's what it is.

Change-Id: I45fa1de000cdd25990d3e292bc129a8a12af65c6
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-08-06 12:51:59 +00:00
hjk
0567f35e21 Utils: Use Utils::CommandLine as input for ProcessArgs::prepareCommand
Change-Id: Ib5878a159bda0e6b6253f1f4e1abc1acb5ecb573
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-08-06 12:51:52 +00:00
hjk
4a42bcd4e8 Utils/ProjectExplorer: Use FilePath for Runnable::workingDirectory
... and in some using code.

Change-Id: I231ea56628908f7d305d13f07eabe8803fe8a791
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-06 12:51:24 +00:00
hjk
4eec360563 Utils: Remove one ProcessArgs::expandMacros overload
Only used once.

Also allow logging of expansion failures.

Change-Id: I357ed6ed28fe379d482358c46b495bc727f86902
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-06 11:36:09 +00:00
Eike Ziller
f18ac508e8 Move CommandLine out of fileutils.h
to ProcessArgs and rename the files to commandline.*.
fileutils was a strange place for CommandLine, and this
reduces the dependencies needed for sdktool.

Change-Id: I9d7e8ffe8a3560f5d12934457b086f9446976883
Reviewed-by: hjk <hjk@qt.io>
2021-05-11 13:27:23 +00:00