summaryrefslogtreecommitdiffstats
path: root/util/cmake/special_case_helper.py
Commit message (Collapse)AuthorAgeFilesLines
* configurejson2cmake: Generalize special case supportJoerg Bornemann2020-07-131-18/+8
| | | | | | | | | The SpecialCaseHandler supported only two file names: "CMakeLists.txt" and "configure.cmake". Generalize the code to allow for arbitrary file names. We will use this in a subsequent commit. Change-Id: I0adada91409a11a369fd1cf2d6ab21cc8f28ba0f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Support special casing in configure.cmakeMÃ¥rten Nordheim2020-05-051-12/+29
| | | | | Change-Id: Ib899a5446a81e2604ba3642b9ad37aedc18ca650 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* pro2cmake: Clean up debug messagesAlexandru Croitor2019-11-121-13/+16
| | | | | | | | | | | Don't needlessly show a bunch of special case debug messages unless debugging is enabled. There used to be a barrage of scary message when using run_pro2cmake. Change-Id: I49ab3522e11844a99653034b5f15a634a368d227 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Improve styling of util/cmake scriptsCristian Maureira-Fredes2019-09-181-75/+90
| | | | | | | | | | | | | | | | | | | | | | flake8 was used to evaluate the file, with a couple of exeptions: E501,E266,W503 black was used to reformat the code automatically The changes were: * Added a README that explains how to use pipenv and pip, * Remove unnecessary return statements, * Remove '\' from the end of the lines, * Use f-strings (>= 3.6) since we are requiring Python 3.7, * Commenting unused variables, * Adding assert when Python >= 3.7 is not being used, * Wrapping long lines to 100 (Qt Style), * Re-factoring some lines, * Re-ordering imports, * Naming `except` for sympy (SympifyError, TypeError) Change-Id: Ie05f754e7d8ee4bf427117c58e0eb1b903202933 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Improve special case handler to work on WindowsAlexandru Croitor2019-06-111-4/+20
| | | | | | | | | There were some issues with not finding the git executable and trying to remove read-only files / files that are still held by a process. Change-Id: I7f587c4e96cff763cc0b3438d9ed2249da8f122f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix special_case_handler to handle git add prev_CMakeLists.txt betterAlexandru Croitor2019-06-041-2/+26
| | | | | | | | | | | | | | | | | When using run_pro2cmake.py, it spawns multiple instances of pro2cmake.py. If more than 1 of the instances need to git add prev_CMakeLists.txt at the same time, git add might fail due to the acquired index.lock. The cleaner solution would be to use a file lock as a mutex, but that requires an external pypi package. Use a poor man solution of retrying the git add with a time delay for a finite amount of times. Change-Id: I2031f6e29ae499526cb4f1753e4387e7f4fab0ab Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Improve special_case_helper.pyAlexandru Croitor2019-06-041-3/+13
| | | | | | | | | | | | | | Make sure to set the author user and email for the temporary git repo, so that the commits succeed on systems that don't have a global git author. Also fix run_process_quiet to print stderr and stdout in case if the execution failed for some reason. Change-Id: I0ddb61730114b3e9c59e2d23480df0ced8d6e772 Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com> Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Keep "special case" modifications when regenerating project filesAlexandru Croitor2019-05-091-0/+347
The pro2cmake.py file is now smarter, and can reapply "special case" modifications after regenerating a CMakeLists.txt file. This substantially lowers the maintenance burden when regenerating many files at once. See the special_case_helper.py file for details on how it works. Make sure to commit the generated .prev_CMakeLists.txt file alongside your CMakeLists.txt changes. To disable the preservation behavior, you can pass -s or --skip-special-case-preservation to the script. To keep around temporary files that are created during this process, you can pass -k or --keep-temporary-files. To get more debug output, pass --debug-special-case-preservation. Fixes: QTBUG-75619 Change-Id: I6d8ba52ac5feb5020f31d47841203104c2a061d8 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>