aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qmlcachegen
Commit message (Collapse)AuthorAgeFilesLines
* Remove the qmake project filesFabian Kosmale2021-01-151-39/+0
| | | | | | | | | Remove all qmake project files, except for examples which are used to test that qmake continues to work. Change-Id: Ic4abb72dc2dcd75df7a797c56056b6b3c5fe62ac Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Add a -i <qmltypes> option to qmlcachegenUlf Hermann2021-01-121-0/+5
| | | | | | | | | | | | | qmlcachegen needs to see the qmltypes file for the current project so that it can query it for C++ types exposed to QML. This is only relevant when generating C++ code, which qmlcachegen itself cannot do. However, in order to write a compatible drop-in, we need it. Also, hide related ignored options from --help in qmlcachegen. Change-Id: Id2f1b8b1750351c7de8dfe49e4065ef1b29423b7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Allow passing --qmljs-runtime to the qmlcachegen implementationUlf Hermann2020-12-021-0/+2
| | | | | | | | | | | | This signals qmlcachegenplus to not paste the whole JavaScript type system into each generated file. In turn, user projects need to add a dependency in order to build against the JS runtime. qmlcachegen ignores the option. Change-Id: I0f87dedb969e99e94fbb712b7faa23d84f76dfbe Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Allow passing --direct-calls to the qmlcachegen implementationUlf Hermann2020-12-011-0/+2
| | | | | | | | | | | | | qmlcachegenplus has an argument --direct-calls which instructs it to call methods of known C++ types directly rather than through the JS engine or the metaobject. This is faster but requires that all those types are visible to the generated code. Introduce a way to pass this option on a per-target base. Adjust qmlcachegen to ignore the option. Change-Id: I474e577e4a197f6ca4c8b8e868dfd39983e77041 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmlcachegen: Move functions to compile QML/JS files to QmlCompilerUlf Hermann2020-10-231-375/+13
| | | | | | | | We need to re-use them. Also, provide a way to insert AOT compiled functions into the C++ code. Change-Id: I7b0d13cb307e8f979745f096a9614f087d135f68 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmlcachegen: Add empty AOT built functions to the loaderUlf Hermann2020-10-231-1/+11
| | | | | | | | This enables us to use the same generateloader.cpp for qmlcachegen and any replacement that actually produces AOT compiled functions. Change-Id: I12fe81236e4ef16a627729c644d54b6c171b3860 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Move generateloader.cpp to QmlCompilerUlf Hermann2020-10-235-244/+7
| | | | | | | We need to be able to generate the loader code from multiple places. Change-Id: I9e04fd3583b535bc5f7d5fb293cb61309c1e199a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmlcachegen: Move resourcefilter.cpp into QmlCompilerUlf Hermann2020-10-205-179/+3
| | | | | | | | For backwards compatibility, a replacement for qmlcachegen will need to provide the same functionality. Change-Id: I22664230ea636d384190122223d15819ebee930c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* CMake: Regenerate projects to use new qt_internal_ APIAlexandru Croitor2020-10-062-2/+2
| | | | | | | | Modify special case locations to use the new API as well. Task-number: QTBUG-86815 Change-Id: I3b964e3baf0cc7040830156dac30358ea1152801 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* QmlCompiler: Rename ResourceFileMapperUlf Hermann2020-10-051-3/+3
| | | | | | | The file class names should start with a common prefix. Change-Id: I5e014c103668a1bc73d359b00a1dda33e5637a79 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Long live libQtQmlCompiler!Ulf Hermann2020-10-054-15/+4
| | | | | | | | Move all the code from tools/shared into src/qmlcompiler and build a static library from it so that we can re-use it in external tools. Change-Id: I7c8d8e59063dc7c711f4072f103a01095e6f5997 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* CMake: Install public qmake .prf files into the prefix mkspecs dirAlexandru Croitor2020-09-211-0/+12
| | | | | | | | | These are needed for qmake projects. Fixes: QTBUG-86802 Task-number: QTBUG-86498 Change-Id: I09c05a358fa580a3a9eab002c6ada42ad70e999c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Prepare Qt5QuickCompiler.cmake.in for Qt6Ulf Hermann2020-07-055-97/+17
| | | | | | | | | | Increment all the version numbers. Replace qtquick_compiler_add_resources with a warning and a call to qt6_add_resources. Task-number: QTBUG-85190 Change-Id: Ifed5449ab4d6312a57add870eee13175872146db Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Revive QTQUICK_COMPILER_SKIPPED_RESOURCESUlf Hermann2020-06-301-0/+12
| | | | | | | | | There are valid reasons not to compile some resources with qmlcachegen. Pick-to: 5.15 Fixes: QTBUG-85243 Change-Id: I9a1233864ed5dda0c264e61db596a9d8c80ea1f3 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Port QtDeclarative from QStringRef to QStringViewKarsten Heimrich2020-06-161-1/+1
| | | | | | | | Task-number: QTBUG-84319 Change-Id: I2dcfb8a2db98282c7a1acdad1e6f4f949f26df15 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* qtquickcompiler: Fix compilation from different drive (Windows)Kai Koehne2020-06-161-2/+1
| | | | | | | | | | | In this case the absolute path on Windows will start with e.g. "C:/", which is not a valid file name. Therefore also convert colon to an underscore. Pick-to: 5.15 Fixes: QTBUG-84901 Change-Id: If79245a5dda5a699f3dceb8e4f08e5a206d566a3 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* CMake: Regenerate qtdeclarative/toolsAlexandru Croitor2020-05-292-1/+2
| | | | | | | | Includes - A bunch of TARGET_DESCRIPTION Change-Id: I6acfe05187afbdd45cf7e1bf8634f1554a51c791 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Port qmlcachegen to QRegularExpressionLars Knoll2020-04-241-2/+2
| | | | | | Change-Id: I2de2cb1c04c58b750531f8f00981bcce0bd724ba Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Move qmllint's metatype support to tools/sharedUlf Hermann2020-04-012-3/+7
| | | | | | | | | We want to read qmltypes files and analyze scopes also from other tools. Furthermore, restructure the shared directory, so that each tool only includes what it needs. Change-Id: I96a2dcc8b1c5fac613592fb1867bf51fa5ef3a6e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* CMake: Regenerate and adapt to merge from devwip/cmakeAlexandru Croitor2020-03-122-6/+2
| | | | | | Change-Id: If8daa6152a563d4309d7342414780ef75b9f5589 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
* Merge remote-tracking branch 'origin/dev' into wip/cmakeAlexandru Croitor2020-03-123-4/+5
|\ | | | | | | | | | | | | | | Conflicts: dependencies.yaml src/qml/qml/qqmlengine.cpp Change-Id: I6a73fd1064286f4a2232de85c2ce7f80452d4641
| * Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-03-091-3/+3
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qqmlirbuilder_p.h src/qml/qml/qqmlpropertycachecreator_p.h src/qmltyperegistrar/qmltypesclassdescription.cpp src/qmltyperegistrar/qmltypesclassdescription.h src/qmltyperegistrar/qmltypescreator.cpp src/quick/items/qquicktext_p.h src/quick/util/qquickvaluetypes_p.h Change-Id: Ic209741592e7b85820bf3845722023a190ebc1c5
| | * Restore offset/length in QQmlJS::DiagnosticMessageSimon Hausmann2020-03-021-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is needed in a few places outside of declarative, so this change restores the loc member in DiagnosticMessage and moves QQmlJS::AST::SourceLocation into common's QQmlJS namespace/directory. QQmlError is unaffected and retains only line/column. Amends d4d197d06279f9257647628f7e1ccc9ec763a6bb Change-Id: Ifb9d344228e3c6e9e26fc4fe112686f9336ea2b2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
| * | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-02-171-0/+1
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/imports/qtqml/plugin.cpp src/qml/qml/qqml.h src/qml/qml/qqmlmetatype.cpp src/qml/qml/qqmlmetatype_p.h src/qml/qml/qqmltypeloader.cpp src/qml/types/qqmlbind.cpp src/quick/items/qquickitemsmodule.cpp tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp Change-Id: I52548938a582cb6510271ed4bc3a9aa0c3c11df6
| | * Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-02-061-0/+1
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/qml/types/qqmlbind.cpp src/quick/items/qquicklistview.cpp tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp Change-Id: Id6805c13256ad13d5651011e5dd09bba0ec02987
| | | * Run qtEnsurePluginResourcesCpp() from qtquickcompiler.prfUlf Hermann2020-01-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was missed when factoring out the resources flattening. Fixes: QTBUG-81699 Fixes: QTBUG-81713 Change-Id: I6ee42c0b91aaa57c593b218eb52359205098e5c6 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * | | Use QTypeRevision for all versions and revisionsUlf Hermann2020-02-031-1/+1
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In many places we carry major and minor versions or revisions that are loosely coupled to minor versions. As the Qt minor version resets now, we need to handle these things more systematically. In particular, we need to add a "major" part to revisions. QTypeRevision can express the current major/minor pairs more efficiently and can also be used to add a major version to revisions. This change does not change the semantics, yet, but only replaces the types. Change-Id: Ie58ba8114d7e4c6427f0f28716deee71995c0d24 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | | Merge remote-tracking branch 'origin/dev' into wip/cmakeLeander Beernaert2020-01-161-1/+2
|\| | | | | | | | | | | Change-Id: I0c5b939c70bdb91ccdf7068784308416dcaa5736
| * | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-01-091-1/+2
| |\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/particles/qquickitemparticle.cpp src/qmlmodels/qqmladaptormodel.cpp tests/auto/particles/qquickitemparticle/tst_qquickitemparticle.cpp Change-Id: Ibd8fbb91da6893a09f4ffe61ad0b95d8149bbc87
| | * Fix usage of qtquickcompiler.prf after lrelease.prfJoerg Bornemann2019-12-171-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Consider a project that sets CONFIG += lrelease embed_translations qtquickcompiler qtquickcompiler.prf is loaded first and loads resources.prf. Then lrelease.prf is loaded and extends RESOURCES. The latter changes are never picked up, because resources.prf was already loaded which is recorded in QMAKE_INTERNAL_INCLUDED_FEATURES. Use the newly introduced qtFlattenResources function instead of fully loading resources.prf. Task-number: QTBUG-79672 Change-Id: I1894ede97b4d5de567971a1a8cef407460bba97d Reviewed-by: Kai Koehne <kai.koehne@qt.io>
| * | Avoid deprecated non-q-prefixed hex() functionUlf Hermann2019-12-171-1/+1
| | | | | | | | | | | | | | | | | | | | | Use Qt::hex() instead. Change-Id: I46bc2f2006ce860cd938a86432783011365c8164 Reviewed-by: Liang Qi <liang.qi@qt.io>
* | | Post Merge FixesLeander Beernaert2019-11-252-2/+8
| | | | | | | | | | | | | | | Change-Id: I13bc3aef318d8b497b01c61fcca7760abd96339a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | | Merge remote-tracking branch 'origin/dev' into wip/cmakeLeander Beernaert2019-11-253-221/+4
|\ \ \ | | | | | | | | | | | | Change-Id: I48b9c2e4f3a75c18470c55f73f2089dc1401de54
| * | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-10-273-221/+4
| |\| | | | | | | | | | | | | | Change-Id: I4f7033b15c8ac8cff685e7c1a5a6b0343313c98c
| | * | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-10-263-221/+4
| | |\| | | | | | | | | | | | | Change-Id: Iaa7dbbe9926d25cfb1b1c51e7013e58cb71d86b5
| | | * Add support for scanning qrc files in qmlimportscannerAndy Shaw2019-10-243-221/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reuses the ResourceFileMapper and extends it slightly to return full paths on request. Subsequently, this is moved into a shared directory inside tools. Fixes: QTBUG-55259 Change-Id: Ice5fc68d03b767a4185742e182556ab4290bd28d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | | | Regenerate all projects with new CMake API versionAlexandru Croitor2019-11-152-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Ie0db35f674137c229eaf049616f38f8e818f7092 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | | Regenerate projectsAlexandru Croitor2019-11-142-8/+6
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I38044c382e4d84b5865a19cdd04cc8922bd72a77 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | | Merge remote-tracking branch 'origin/dev' into wip/cmakeAlexandru Croitor2019-10-145-314/+41
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | Removed dependencies.yaml because we don't use it yet in wip/cmake. Fixed conflict in qmlcachegen.cpp. Change-Id: Ie1060c737bee1daa85779903598e5b6d5020d922
| * | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-09-225-2/+192
| |\| | | | | | | | | | | | | | Change-Id: I801567c11fcc3244a1ee7dabeb5079d49fc5c3a1
| | * | Fix link errors when enabling CONFIG+=qtquickcompiler on non-QML projectsSimon Hausmann2019-09-191-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Re-apply commit c5578b16d6454e708c8ce12661a85d41eeaaa758 now that with commit 41864db3b61d9e81a9fe4906918d2cd3d6d32a0c the .qml/.js/etc. files are always retained. The difference is that now this is not an error situation but merely a reason to skip processing. Fixes: QTBUG-73669 Change-Id: I53e1e7d471a66e82694ceca83c548c03aaf88f87 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| | * | Fix regression when using CONFIG+=QtQuickCompiler and .qrc files in subdirsSimon Hausmann2019-09-195-2/+182
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 41864db3b61d9e81a9fe4906918d2cd3d6d32a0c removed the processing of .qrc files that removed .qml/etc. files. Since the chaining of resources remains critical to ensure that the cached compilation units are loaded, the build system copied the input .qrc file to a new one. That mere copying caused the build to break when the copied .qrc file was not in the same directory as the original one, as file paths within the .qrc file are interpreted as relative to the .qrc file, which was now in a different location. To fix this, this patch brings back the "filtering" code that rewrites the paths to the source files in the .qrc file. Fixes: QTBUG-78253 Change-Id: Ie1d56f3248e713a964260bc2da37c9374f7b6a36 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| * | | Merge remote-tracking branch 'origin/wip/qt6' into devSimon Hausmann2019-09-191-1/+1
| |\ \ \ | | |/ / | |/| | | | | | Change-Id: I10c4b7fcfa0397d999d45e310c2f8f051d57d4d2
| * | | Fix *.js files disappearing from RESOURCES when not using QtQmlSimon Hausmann2019-09-096-472/+11
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QtQml][Important Behavior Changes] Using the Qt Quick Compiler would exclude the original .qml files from the resource system. This made it impossible to change the Qt library binary later as the program binary was tied the to the exact Qt version. In addition sometimes unrelated files (QTBUG-73669) were removed. For the latter scenario, retain and skip options were added for the Qt Quick Compiler. In Qt 5.15 the Qt Quick Compiler does not remove the input files anymore. All files are retained and the compiler merely adds the more efficient binary representation to the application. Task-number: QTBUG-73669 Change-Id: I5a523bfc69d4f48a1451bd880616c82fd73b8d15 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | | Merge remote-tracking branch 'origin/wip/qt6' into wip/cmakeAlexandru Croitor2019-10-113-10/+12
|\ \ \ | | |/ | |/| | | | Change-Id: I4a91928610f79c8e21a05781953ffa41508c828a
| * | Merge remote-tracking branch 'origin/dev' into wip/qt6Ulf Hermann2019-09-053-10/+12
| |\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/qml/qml/qqmlengine.cpp src/qmlmodels/qqmlmodelsmodule.cpp Change-Id: Id60420f8250a9c97fcfe56d4eea19b62c6870404
| | * Merge "Merge remote-tracking branch 'origin/5.13' into dev"Qt Forward Merge Bot2019-08-201-10/+0
| | |\
| | | * Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-08-201-10/+0
| | | |\ | | | | | | | | | | | | | | | Change-Id: I9ce3eee3d6f88783b9e20110a2814bee805291a4
| | | | * Merge remote-tracking branch 'origin/5.12' into 5.13Liang Qi2019-08-051-10/+0
| | | | |\ | | | | | | | | | | | | | | | | | | Change-Id: I042df89ddd381c7fbb944b7ff49d5b45b764fd47
| | | | | * Revert "Yield error if qtquickcompiler is used in non-QML projects"Jörg Bornemann2019-08-021-10/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit c5578b16d6454e708c8ce12661a85d41eeaaa758, because it prevents enabling the qtquickcompiler feature globally. Fixes: QTBUG-77277 Change-Id: Ic80835c462570a67ae3105bb3d1b6452800d2c94 Reviewed-by: Kai Koehne <kai.koehne@qt.io>