aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib
Commit message (Collapse)AuthorAgeFilesLines
* Android: Update for Qt 5.15Raphaël Cotty2020-10-211-2/+2
| | | | | | | | | | | | Use java.additionalClassPaths property to allow compilation of binding classes because starting with Qt 5.15 they depend on QtAndroid.jar Update AndroidManifest.xml with uses-sdk node using new properties Android.sdk.minVersion and Android.sdk.targetVersion because Qt 5.15 uses androiddeployqt to set it. Fixes: QBS-1580 Change-Id: I2fa5e77bb183be1b55e9dd9756fb7b6eb1f3c9d4 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* ModuleLoader: Fix scope for RHS of module provider property bindingsChristian Kandeler2020-08-041-1/+1
| | | | | | | | The scope should be the product item itself. Fixes: QBS-1587 Change-Id: Iccdc89e3b57d6ee1f11205961cf6244ea560f425 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* Fix data race when calling LauncherSocket::isReadyIvan Komissarov2020-07-303-18/+20
| | | | | | | | According to C++ standard, it is not allowed to read/write non-atomic variable from different threads. Change-Id: Ia48a997b1f417ed68234afdcaad6d70c92d26064 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Fix loading optional transitive dependenciesIvan Komissarov2020-07-162-3/+14
| | | | | | | | | | If optional module B depends on an invalid module A (i.e. whos validate script throws an exception), module B should be not present as well. Fix that by remembering the initial value of the "required" property in the Depends item. Change-Id: Ia21587b3f5a8bd49c12b9f31b65e009fb2eeafb9 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Initialize Depends item in aggregator Product properlyRichard Weickelt2020-07-071-0/+2
| | | | | | | Default properties were not initialized, but we do it everywhere else. Change-Id: I43226b7e683efe9295f1d587e374ef786d602ddb Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Avoid unwanted defines when building bundled QtScriptChristian Stenger2020-07-071-0/+6
| | | | | | | | | When building Qbs there might be project defines present that make the compile fail. Drop these defines if present. Change-Id: I24532efca94560a21690f3016282a8f9420abe54 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Android: Add support to generation of aab packageRaphaël Cotty2020-06-253-5/+10
| | | | | | | | | This patch adds the Android.sdk packageType property which sets the target application. By default (previous behavior) qbs generates an apk package. When set to aab, qbs generates instead an aab package Change-Id: Ic09776d08e2a2ecd68fb4c08881201a7a0a25240 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Fix Qt 5.15 deprecation warningsChristian Kandeler2020-06-1610-11/+36
| | | | | Change-Id: I1d6968de823c43e42ca53eb68972ba5e69dc29ed Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* Fix possible race in ~InternalJobThreadWrapper()Ivan Komissarov2020-06-161-4/+3
| | | | | | | | | | | It might happen that finished() is emitted before the call to connect() to the QEventLoop::quit slot resulting in endless loop. Fix that by calling QCoreApplication::processEvents() directly. Change-Id: Ic0899c4d5b04d095b26912b9693ae245df6da4f2 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Fix '-Wclazy-range-loop' warningsIvan Komissarov2020-06-083-4/+6
| | | | | | | The warning says 'c++11 range-loop might detach Qt container' Change-Id: I6b6a91d6b3298702246da94f05d21623d5f13faa Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ProductData: return members by const-referenceIvan Komissarov2020-06-024-34/+32
| | | | | Change-Id: I865d28b8fd930820c7145a3bf8aa76b2dd677550 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ProjectData: return const values/referencesIvan Komissarov2020-05-253-20/+17
| | | | | | | | | | | Qbs does not care that much about binary compatilibity (because of qbs session) and thus is is preferable to return members by const-ref (saving 2 atomic operations and preventing from accidental detaches). In case when method needs to compute some value instead of returning member directly, the function signature can be changed. Change-Id: I4e8d228761a990d274e77652c94adf9f43a758f1 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Merge branch '1.16'Ivan Komissarov2020-05-201-2/+0
|\ | | | | | | Change-Id: I9920b1dc853c8c0051e5c5be5e570c2ca38880e6
| * Remove deleting trailing slash from VS env varsSergey Zhuravlev2020-05-191-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | After launching msbuild from QBS I got an error "LOGGERBASEDEXECTASK : ILC error ILC1004: Directory 'C:\Program Files (x86)\Windows Kits\10lib\10.0.15063.0\um' passed to argument 'targetplatformsdklibpath' does not exist.". Seems those trailing slashes are important. Change-Id: I2839d7054c866207bbaeef3e21a4ea6a9679f477 Fixes: QBS-1551 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
* | Fix ModuleLoader::moduleProviderConfigIvan Komissarov2020-05-111-3/+3
| | | | | | | | | | | | | | | | | | | | | | The function stopped too early in the ItemValueType branch which disallowed to set properties of the multiple module providers. Also, it modified the 'name' parameter resulting in the invalid map key. Change-Id: I549607cb3191134201634c60b72b782874f07556 Reviewed-by: Richard Weickelt <richard@weickelt.de> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Fix item scope for the "moduleProviders." itemsIvan Komissarov2020-04-271-3/+6
| | | | | | | | | | | | | | | | This patchset allows to use "product." and "project." properties on the right-hand side of the "moduleProviders." properties. Change-Id: Ib9afca4751cd4db40d3a703fd179860de362b0fa Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | clang-tidy: Fix 'cppcoreguidelines-pro-type-member-init' warningsIvan Komissarov2020-04-276-16/+10
| | | | | | | | | | | | | | | | | | | | | | Also, fix undefined behavior when setting and reading different field of a union (Lexer, Token) - according to the C++ Standard, it is not allowed to use a union to zero members of a struct. Treat these warnings as errors now. Change-Id: I0f6d071217ef55e2c75c51138fcff47048eca62f Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Enable QT_NO_CAST_FROM_BYTEARRAYIvan Komissarov2020-04-212-6/+6
| | | | | | | | | | | | | | | | | | Silently casting QByteArray to char* is dangerous and it's hard to find an error in the code. Thus, forbid implicit casting and fix code accordingly. Change-Id: I216f1b19768ad529ff050df0e81bfc4ad10b7c00 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | clang-tidy: Fix 'readability-*' warningsIvan Komissarov2020-04-202-7/+5
| | | | | | | | | | | | | | Treat those as errors except for the 'readability-container-size-empty' Change-Id: I6a8bb9d68fb5bc89697cc42179337d338a51035e Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Move some Visual Studio generator parts into libqbsmsbuildJake Petroules2020-04-1762-24/+3891
| | | | | | | | | | | | | | | | | | | | | | | | This static library contains the MSBuild and Visual Studio solution object model classes and serialization code, without any qbs project model specifics. The latter goes into the generator plugin itself. The Xcode generator will follow the same separation of concerns design when it is introduced. Change-Id: I0a7aca2457c7b7474e0a0a127a3ce5fbec7682f6 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Merge branch '1.16' into masterRichard Weickelt2020-04-156-7/+18
|\| | | | | | | Change-Id: Ie3f341fe18e2ffaf676721748279c6b027590727
| * GCC: fix detection of Mingw prefix in MXEAlberto Mardegan2020-04-151-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The toolchain paths in MXE are of the form $MXE_PATH/usr/bin/x86_64-w64-mingw32.shared-g++ so we should not assume that what follows the dot is an extension that needs to be stripped (like QFileInfo::completeBaseName() does). Instead, only strip the know executable extensions. Change-Id: I51040d65e372ef3152ddd9229dd33011661c2b46 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Richard Weickelt <richard@weickelt.de> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
| * session: Fix reading values from JSONIvan Komissarov2020-04-131-3/+3
| | | | | | | | | | | | | | | | | | | | Apparently, QJsonObject.isNull() returns false in case if key is not present in the map. This leads to wrong default values e.g. in case of the "fallback-provider-enabled" key. Fixes: QTCREATORBUG-23852 Change-Id: Idc85b3fd3a21fc4ce704c112c8c5b7a842cf57ba Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
| * Exclude VariantValues when checking for conflictsRichard Weickelt2020-04-061-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Qbs prints a warning when different modules contain conflicting assignments to scalar properties. This check assumed that the source values were always of type JSSourceValue and thus performed a invalid static cast which caused sporadic crashes on macOS in TestLanguage::moduleMergingVariantValues. No crashes were obtained on other platforms, but that was only a coincidence. This patch amends 8ff1dd00. Change-Id: Id4809496a5fbc4985d040118a4684f3ac040cdc0 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
| * Fix accessing temporary object dataIvan Komissarov2020-04-061-3/+3
| | | | | | | | | | | | | | Dectected by the 'clazy-returning-data-from-temporary' check Change-Id: I2ab979bb1d58ea96a36d0331aeffa6a719d2f423 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
| * Fix crash in operator==(ArtifactProperties, ArtifactProperties)Ivan Komissarov2020-03-202-0/+2
| | | | | | | | | | | | | | | | Also, make operator==(SourceArtifactInternal, SourceArtifactInternal) more robust Change-Id: I2eb276621d304c7ac5fa7c78af00db09b0c2e3c4 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | clang-tidy: Fix 'bugprone-narrowing-conversions' warningsIvan Komissarov2020-04-147-21/+25
| | | | | | | | | | | | | | Also, treat those as errors Change-Id: I0771aa656273fd0a01c7787870d9de9b4c631823 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | clang-tidy: Fix 'readability-redundant-control-flow' warningsIvan Komissarov2020-04-142-2/+0
| | | | | | | | | | | | | | Also, treat those as errors Change-Id: I7f27e6d19d7208dcb1ab083091e01f41017fb8bf Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | clang-tidy: Fix 'modernize-return-braced-init-list' warningsIvan Komissarov2020-04-081-2/+2
| | | | | | | | | | | | | | Also, treat those as errors Change-Id: I566d3ea18965bb18df53a01914023ec73fccc620 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | clang-tidy: Fix 'google-readability-casting' warningsIvan Komissarov2020-04-071-7/+5
| | | | | | | | | | | | | | Also, treat those as errors. Change-Id: I206844540eae6eef1e921f19453402a0c2874552 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | clang-tidy: Fix 'google-readability-namespace-comments' warningsIvan Komissarov2020-04-073-3/+3
|/ | | | | | | Also, treat those as errors Change-Id: I33e5adef456b2c3445e00297d48770d99781aedd Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Add qbs.hostArchitecture propertyIvan Komissarov2020-03-111-0/+3
| | | | | | | | | | This property can be useful when some parts of the project (e.g. helper tools) should be compiled for the host platform/architecture disregarding what targetPlatform/architecture the rest of the project is being built for Change-Id: I8c76ef65470130df59826603157083fd20809592 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Add clang-cl to the list of known toolchainsIvan Komissarov2020-03-061-1/+6
| | | | | Change-Id: I4521ac3de8822a9b7fecb33f6aa27cb380f01ed9 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Rule execution: Fix potential infinite loopChristian Kandeler2020-03-051-0/+2
| | | | | | | | | | | | | | | | | | Dependency scanning can generate inverse dependencies. For instance, a Qt C++ file "myobject.cpp" containing the Q_OBJECT macro will typically include a file "myobject.moc", which is generated from the cpp file. When scanning the inputs of "myobject.moc", the artifact will encounter itself as a scan dependency. There is code that prevents a dependency cycle in this case. Let's now consider the case where such a rule has a second output artifact: When scanning the inputs of that artifact, we will encounter the first artifact as a scan dependency. This case was not handled, leading to an infinite loop in rule execution. We fix this by rejecting scan dependencies that have the same transformer as the artifact whose inputs are being scanned. Change-Id: I767ceaad387c2e315738070e01ef9322764afb65 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Artifact Scanning: Prefer scan results from product dependenciesChristian Kandeler2020-03-031-2/+14
| | | | | | | | | | | | | | | | If scanning finds an artifact in more than one product, we so far randomly used one of them. We now prefer artifacts from product dependencies, because the other ones might get lost during change tracking, as we don't keep an "is scan result of" type of information in our RescuableArtifactData. This should fix the linked bug in the vast majority of actual projects. It's also conceptually the right thing to do, because the artifact in the product dependency is much more likely to be the one that was intended to be found. Task-number: QBS-1532 Change-Id: Idd8662bb00570bc57f5861ce83517f0adb845b49 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Use std::vector for the probeBindings in ModuleLoader::resolveProbe()Ivan Komissarov2020-03-021-4/+4
| | | | | | Change-Id: Idaaed904006e421a015eefab6daf2b1b392b2ad4 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Use std::vector instead of QList in ModuleLoader::m_currentProbesIvan Komissarov2020-03-022-2/+2
| | | | | Change-Id: Ic48a8ddba1fd4d461a7ecc2e6d2c256323d9375c Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Use std::vector instead of QList in ModuleLoader::m_oldProjectProbesIvan Komissarov2020-03-021-1/+1
| | | | | Change-Id: I2f45445bab160997ea2724a58b45189d624158d3 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Simplify ModuleLoader::searchAndLoadModuleFileIvan Komissarov2020-02-271-34/+36
| | | | | | | | | | | | | | | | The algorithm is more natural now: - first, we try to find module files in the current searchPaths - second, if nothing was found, we try to extend the search paths by using Providers - third, we try to load module Items from the found files - finally, choose a candidate or give up if nothing was loaded This allows to get rid of the recursive call which was needed to execute the logic from step 3 with newly added search paths as step 3 was done in the same loop as step 1 Change-Id: Ie6c244c5f649bcb1b96eb2c5edca503439f3f7a7 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Extract some code to ModuleLoader::findExistingModulePaths()Ivan Komissarov2020-02-272-8/+19
| | | | | | | | This allows to get rid of the matchingDirectoryFound variable to reduce possible states in the function Change-Id: I2a86ba7e4e9a35d5c15ae48756c84136c855bcfa Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Avoid useless allocations in Item::propertyDeclarationIvan Komissarov2020-02-271-7/+7
| | | | | | | | PropertyDeclaration() allocates Private class which can be easily avoided by using iterator API Change-Id: I8240fe845b8a4d8f3ad8f8372f5bca178982ab29 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Fix the error when the last module candidate is not a moduleIvan Komissarov2020-02-271-3/+4
| | | | | | | | | | Previously, if the last module candidate was not a module item, the value of triedToLoadModule was set to 'false'. However, we could try to load the one of the previous candidates which means that triedToLoadModule should be set to 'true' Change-Id: I03278d51804568ebbd4dee93313c16517fd774e9 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Fix erasing elements in the vectorIvan Komissarov2020-02-271-1/+1
| | | | | | | | | end() should be re-calculated after erase() This amends e5f115d25 Change-Id: I6ce59cf8d475f561390ccab0ee41dbf67aeeafe5 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Extract some searchAndLoadModuleFile() code into getModuleFileNames()Ivan Komissarov2020-02-262-10/+18
| | | | | | | | | To reduce the complexity of this function and make it more readable Also, avoid triple lookup in the m_moduleDirListCache map Change-Id: Ia838148593b9781092314fce24844e4db3e257da Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Do not call isFileCaseCorrect that oftenIvan Komissarov2020-02-262-5/+16
| | | | | | | | 'qbs resolve qtcreator.qbs' results: macOs: 0m31.510s -> 0m26.417s Change-Id: Ibd69ba87f5515e99776e6af2f87587e711213b41 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Autodetect clang-cl by using ProbeIvan Komissarov2020-02-175-4/+281
| | | | | | | | This allows to build projects without calling "qbs setup-toolchains" first by simply calling "qbs build qbs.toolchainType:clang-cl" Change-Id: I86d135ddf2cb588f322709e4e7a265cb6fd7772f Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Avoid double lookup in ModuleLoader::handleSubProjectIvan Komissarov2020-02-171-1/+1
| | | | | Change-Id: Ia26b49324377c00d9c897932f4df7624436ef96b Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Autotedect MSVC compiler by using a probeIvan Komissarov2020-02-143-0/+421
| | | | | | | | This allows to build projects without calling "qbs setup-toolchains" first by simply calling "qbs build". Change-Id: Iba4af8bf77d0ee5d209564ea371328d3c6cf2aa2 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* clang-cl: Fix macro dumpingIvan Komissarov2020-02-141-21/+26
| | | | | | | | | | Previously, clang.exe was used to dump macro as clang-cl does not support the MSVC way. Also, architecture was not detected correctly because of the wrong assumption that clang-cl respects arch variables set by the vcvarsall.bat Change-Id: Ic6464c2bd90f1a2fceb2f8aa884721872179ff49 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Merge branch '1.15' into masterRichard Weickelt2020-02-053-2/+14
|\ | | | | | | Change-Id: I7e348db380b836221db79c73ea3b5f1d891f114b