aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/corelib/api/runenvironment.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Use pass-by-value and moveIvan Komissarov2019-03-071-8/+8
| | | | | | | This fixes -Wmodernize-pass-by-value Change-Id: I85a732867866e43c39c1d77937fbc645433c96bd Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Fix calls to non-const begin()/end() in range-for loopsIvan Komissarov2019-03-061-2/+4
| | | | | | | | This fixes -Wclazy-range-loop Change-Id: I08a435b700017cdbe27fbfdbda6e26840d9a3568 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Return initializer list where it is possibleDenis Shienkov2019-02-261-5/+5
| | | | | | | | | This fixes this clang-tidy warning: warning: avoid repeating the return type from the declaration; use a braced initializer list instead [modernize-return-braced-init-list] Change-Id: I421e1e47462fe0e97788672684d47943af7df850 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Use QStringLiteral more where it is possibleDenis Shienkov2019-02-251-12/+12
| | | | | | Change-Id: I7419cc3fbc1e8776de3943852dcedab4c95d1c32 Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Call QProcess::waitForFinished with timeout of -1Joerg Bornemann2018-06-141-2/+2
| | | | | | | | | The default value of 30 s can be too short for environments like virtual machines under heavy load. Task-number: QBS-1360 Change-Id: I83af7740dc842faf8795f5901f36744229160154 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* RunEnvironment: Add safety check for API mis-useChristian Kandeler2018-02-211-2/+12
| | | | | | | | | It makes no sense to try to run a disabled product. Task-number: QBS-1306 Change-Id: I07e36bc8f787d702ed9caa21972537e588db57e8 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Properly take the --dry-run option into account in the "run" commandChristian Kandeler2018-01-121-50/+67
| | | | | | | Do not try to execute the virtual binary. Change-Id: I19b0a9e7600b33cb42c4ab60f689dd4c3329930b Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Remove dependency on QtXml in RunEnvironmentJake Petroules2017-11-301-11/+14
| | | | | | | | The strings returned by aapt dump badging are not technically XML, and the more strict QXmlStreamReader can't parse them anyways. Change-Id: I05b53989f18c89567af1912ee210873dcbe461c9 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* corelib: Gather string constants in central placeChristian Kandeler2017-11-291-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The same string literals appeared over and over again in the code base, causing redundancy in the sources as well as at run-time. We now give them a name and make sure they get instantiated at most once. String literals that occur only once are converted from QLatin1String to QStringLiteral unless they appear only in contexts that make use of QLatin1String overloads or they are clearly outside of any hot code paths. This seems to result in small, but measurable performance improvements, even if we assume the 1% changes to be noise: ========== Performance data for Resolving ========== Old instruction count: 3266514138 New instruction count: 3209355927 Relative change: -2 % Old peak memory usage: 29649896 Bytes New peak memory usage: 29436264 Bytes Relative change: -1 % ========== Performance data for Rule Execution ========== Old instruction count: 3367804753 New instruction count: 3319029596 Relative change: -2 % Old peak memory usage: 19577760 Bytes New peak memory usage: 19091328 Bytes Relative change: -3 % ========== Performance data for Null Build ========== Old instruction count: 608946535 New instruction count: 604566001 Relative change: -1 % Old peak memory usage: 14606384 Bytes New peak memory usage: 14579936 Bytes Relative change: -1 % Change-Id: Ia055a52e0a4b6fe6fd0f1e7ba4bfa583cba1b0ef Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Give the setupRunEnvironment script an additional parameterChristian Kandeler2017-11-221-5/+10
| | | | | | | | | | | Required by follow-up commit. [ChangeLog] The Module.setupRunEnvironment script now has a new parameter "config". Users can set it via the --setup-run-env-config option of the run command. Change-Id: I1be57fcff5321874cf3dcf4fb3a7ef7d6f69a8a5 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Make Module.setup{Build,Run}Environment first-class citizensChristian Kandeler2017-11-201-7/+13
| | | | | | | | | | | They did not have the project and product variables available, and they accessed module properties in a way that made it look as if they were normal properties rather than scripts, which was misleading. Now everything works the same as in Rule scripts and JS commands. Task-number: QBS-744 Change-Id: I11d70876185d528282a56747747dd8310a77fbc4 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* STL compatibility: use empty() instead of isEmpty()Jake Petroules2017-11-161-2/+2
| | | | | | | This is a simple find and replace with manual sanity check. Change-Id: Iab6d46dcc3be246d1650aae2b1730f933b717be8 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Remove superfluous use of QScopedPointer in RunEnvironmentJoerg Bornemann2017-10-131-7/+5
| | | | | | | | The QTemporaryFile object can be created on the stack. Change-Id: Ief886edfff21681b2b2f6ffb425664b511d3c611 Reviewed-by: Jake Petroules <jake.petroules@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Fix shell commandChristian Kandeler2017-10-051-11/+26
| | | | | | | | | | | | | - Use the build environment rather than the system environment (that's the whole point of the command). - Remove the need for a specific product. - Use a more sensible prompt. - Strip down the list of supported options. - Fix typo in comment. Change-Id: I8e4040d44ab6a95e60a7265e05d5b66fb3dfa878 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Add support for running iOS and tvOS apps on the simulatorJake Petroules2017-10-041-21/+54
| | | | | Change-Id: I85e726b6c6508138ec6eb7547307514d9754c960 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Add support for running Android apps on devicesJake Petroules2017-10-041-1/+67
| | | | | Change-Id: I1a3a4afb9742f1c89e6396430d178277ea41c451 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Merge 1.8 into masterChristian Kandeler2017-06-301-18/+3
|\ | | | | | | Change-Id: Ide2b95fba4d91a5fe755c2d7a8375f87552d2e20
| * Fix running bundled applications on Apple platformsJake Petroules2017-06-271-18/+3
| | | | | | | | | | | | | | | | | | | | Previously, Qbs would attempt to run the temporary copy of the application executable in the .tmp/ subdirectory of the product build directory. This patch corrects it so that it is run via the copy in the install root, or the actual bundle executable in the build directory. Change-Id: I988081e3f70ec52965e798c8193b75c2dcc4fdf9 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Fix nodejs/typescript probes when the Node interpreter is not in PATHJake Petroules2017-06-141-5/+8
|/ | | | | Change-Id: I9302a631450a43c25b5cf9bac6b5299f2b728683 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Clean up [q]fileinfo.h includesJoerg Bornemann2017-03-061-1/+0
| | | | | Change-Id: I9bc57750cf67d20f7c4fc7291c38de406078e339 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Remove all usages of Q_FOREACH from the libraryChristian Kandeler2017-02-211-3/+3
| | | | | | | | This will make it easier to experiment with exchanging Qt containers for STL ones, for instance. Change-Id: Ie591fa54b5241ad4841b1ebcfb78b72932cd2b38 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Change style of #includes of Qt headersJake Petroules2017-01-041-6/+6
| | | | | | | | | | | | | | | | By using q<lowercase>.h headers, we become more bootstrap-friendly, as no full syncqt is required any more. In the same go, prefix all includes with the module name. This helps grep-based analysis of which parts of Qt are used and where. It's also consistent with Qt's public headers (where syncqt enforces the style). Testdata and examples are excluded from the change, as they are not relevant for bootstrapping. Change-Id: I9539b1d795e87fca6e5fc6c91acbb775b79208d9 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Remove usage of PropertyFinder from RunEnvironmentJoerg Bornemann2016-12-231-14/+4
| | | | | Change-Id: I3f15233a7dfed1cad79175989cb7310259a437b3 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Add PropertyMapInternal::modulePropertyJoerg Bornemann2016-12-231-2/+1
| | | | | | | | | Add a new convenience method PropertyMapInternal::moduleProperty to access module properties without invoking the PropertyFinder and use it where applicable. Change-Id: Ie573c71516b25ed3159d6c86769baa6b058c0956 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Attach information about the context to our script engineChristian Kandeler2016-11-071-1/+1
| | | | | | | | Certain operations might want to know what the script engine is currently doing. This will be used in a follow-up commit. Change-Id: I90167c29e94e0f77c7d5ccf20787e9749434e728 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Re-display warnings when loading a stored build graphChristian Kandeler2016-09-301-3/+3
| | | | | | | | | [ChangeLog] Warnings encountered during project resolving are now stored and will be re-displayed when the project is loaded. Task-number: QBS-1011 Change-Id: I5fa04d3d537866212abbdf739b09a254843de473 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Update license headersIikka Eklund2016-08-291-14/+23
| | | | | | | | | | Patch-set 2 includes *.cpp *.c Every source file needs to have up-to-date license headers in order to pass ci. Change-Id: Ie6e493097af6f7dd6a8adff170eb856f496e689e Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* RunEnvironment: Be more robustOrgad Shaneh2016-06-141-0/+4
| | | | | | | Do not crash if resolvedProduct is not set. Fallback to initial env. Change-Id: Id08973f9f2a2715d87b38ff9d78a4a34ca526bc2 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Merge remote-tracking branch 'origin/1.5'Joerg Bornemann2016-06-081-1/+1
|\ | | | | | | | | | | | | | | Conflicts: doc/reference/items/transformer.qdoc share/qbs/modules/cpp/GenericGCC.qbs Change-Id: I45560834560019b18274c373c45651eb8aadd206
| * Replace 'the Qt build suite' with 'Qbs' in copyright notices.Jake Petroules2016-06-061-1/+1
| | | | | | | | | | | | Change-Id: I885d94bb14b325dc36767a840ebdb0be1fb59dd2 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | Ignore WiFi devices during iOS deployment.Jake Petroules2016-04-181-0/+1
|/ | | | | | | Deployment cannot be done over WiFi. Change-Id: I893be45e95111d464fc4f0a33085b3546643385a Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
* Do not throw exceptions from the RunEnvironment class.Christian Kandeler2016-04-071-4/+49
| | | | | | | | | Apparently, this class was overlooked when we made the API non-throwing (or it was internal at the time). Task-number: QBS-952 Change-Id: I445436c1ddb3d815a20f44a87438b3cdbccfc156 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Add support for running iOS apps on devices.Jake Petroules2015-10-211-1/+48
| | | | | Change-Id: I86c8278545aa90663719ea1d67d564a04f4e703f Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
* Merge branch 1.4 into master.Christian Kandeler2015-07-311-0/+1
|\ | | | | | | Change-Id: I2ff37ef7c00063f738f7691071c4b638dd2dc7c8
| * Code clean-up in corelib/language/.Christian Kandeler2015-07-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | - Remove unneeded #includes (particularly from header files). - Make inline member function implementations less verbose. - De-QObjectify the Loader class and remove unneeded members & heap allocations. - Minor stuff (const issues, unneeded namespace qualifications). Change-Id: I55f2d7ed98b32faed7582bc6adfa04eb799de874 Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
* | Merge branch 1.4 into master.Christian Kandeler2015-05-111-3/+6
|\| | | | | | | Change-Id: I2dba7958c30b522695827b7b25336278c2fdad3d
| * fix usage of QFileInfo when running nodejsJoerg Bornemann2015-05-041-3/+6
| | | | | | | | | | | | | | | | | | On a Windows machine with Emscripten installed qbs tried to execute the directory ...\Emscripten\node when trying to run nodejs scripts. Check for directories when finding executables to fix this. Change-Id: Icc62d378ffa29c041bd4cabdbaca37550d483cb8 Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
* | Add support for building Common Language Infrastructure assemblies.Jake Petroules2015-04-301-0/+10
|/ | | | | | | | Currently includes support for C#, F#, and Visual Basic. Task-number: QBS-227 Change-Id: I6c82ad2dda6e99b407e31683ccdb3e355b21b21f Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
* Try to forward "bad interpreter" errors to the user.Jake Petroules2015-03-271-1/+22
| | | | | Change-Id: If287b7480be854f4bae055ed9d575f16fd6f54df Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* update license headersJoerg Bornemann2015-03-021-2/+2
| | | | | Change-Id: I36d825db3a5ef32c162c3063aab1e8a1f2696f4f Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
* Merge branch '1.3' into 'master'Christian Kandeler2015-01-281-6/+6
|\ | | | | | | | | | | | | | | | | Conflicts: doc/reference/jsextensions/jsextensions-general.qdoc src/lib/corelib/language/evaluatorscriptclass.cpp src/lib/corelib/language/evaluatorscriptclass.h Change-Id: Ic9b77b56e8fc8bf93e0a553930757de8c93fed22
| * Update LicenseEike Ziller2015-01-261-6/+6
| | | | | | | | | | Change-Id: I092fca9f950de1ba38826c33b155f86feae2770b Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
* | Use new qbs.installRoot property instead of QBS_INSTALL_ROOT env var.Jake Petroules2015-01-081-3/+0
|/ | | | | Change-Id: I7166fc494ab0581d93753408ff81d6655b58052c Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
* License update.Eike Ziller2014-10-161-7/+8
| | | | | | | Add LGPLv3 option. Change-Id: I8a63ad5e46a2701032b2103f791df4dec5b707e8 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Fix run environment setup.Jake Petroules2014-08-281-4/+13
| | | | | | | | | | | | | | | Now Darwin platforms get the same DYLD_* environment variables set as Xcode (plus Qt) so applications can be developed/tested without embedding bundles. This brings equivalent behavior to what already exists on Windows. This also fixes a regression introduced in 5877328c4dacb1283408083cb3538ea5bc46eae5 with the Node.js module, causing the working directory to be inappropriately changed by the run command. Change-Id: Ic2904f105378eb61d9236367329a2f9c8771a7d3 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* Added an API to retrieve the current run/build environmentThomas Epting2014-06-051-0/+12
| | | | | | | | Needed in order to provide the correct run environment when starting a product from within Qt Creator. Change-Id: Iaa1356845daf485d7f4b361a76b559b0b7339ee7 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Add support for running Node.js using qbs run.Jake Petroules2014-04-151-0/+25
| | | | | Change-Id: I98a38e49cbea57d44b787eec12c2cb5f2e5cd601 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Do not share product properties with artifacts.Christian Kandeler2014-02-261-1/+1
| | | | | | | | | | | | | | Since products potentially share their property maps with their groups, artifacts get product properties such as "name" and "destinationDirectory". This is strange and can mess with change tracking. Therefore we split up the product's property map in two: One contains the module properties and is potentially shared with groups, the other has the actual product properties and is not shared. This patch also removes a workaround from an autotest that was required until now to prevent a false positive in change tracking. Change-Id: Ia1f1f0ce32669fd893a99f809753df526bf1442a Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Prepare for using QT_NO_CAST_FROM/TO_ASCII.Jake Petroules2014-01-141-1/+1
| | | | | Change-Id: Ib39e49e896cbddf5a5bd851088500991d962355a Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* Move Qt profile setup into a dedicated library.Christian Kandeler2014-01-101-0/+176
Otherwise all changes to the implementation will have to be duplicated in IDEs. Change-Id: I61e6d4fa1ee9b724eb5d9de9f233dc915a6c8bc3 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>