Commit Graph

112 Commits

Author SHA1 Message Date
Olivier De Cannière 6ae36202fd qmlcachegen: Reject using --only-bytecode with compiler-only options
[ChangeLog][QtQml] qmlcachegen will now exit with a failure state if
--only-bytecode is set as the same time as Script Compiler exclusive
options. The only-bytecode flag skips the compilation altogether.
Remove one of the conflicting flag to solve the issue.

Change-Id: I5c6a0610ec4c2eb06624c2d123ab62bc633a46b8
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2024-08-23 15:44:58 +02:00
Olivier De Cannière 8827af0fe8 Compiler: Record statistics about aot compilation
This patch introduces the collection of statistics about the
ahead-of-time compilation of functions and bindings to Cpp by
qmlcachegen. This is done by having qmlcachegen save an aotstats file
for every qml file it compiles. This file contains, for every function
and binding, whether the Cpp codegen was successful, its duration and a
potential error message

Task-number: QTBUG-124667
Change-Id: Iba9a72be04f6642688533a3ae12ea687296c85e1
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2024-05-28 10:25:41 +02:00
Ulf Hermann 9b78434579 qmlcompiler: Sanitize qmldir paths before using them
They may contain backslashes.

Pick-to: 6.7 6.5
Fixes: QTBUG-125393
Change-Id: Ifd8c97c44b036ab64a221775a7fe6316445f6cf8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2024-05-17 17:34:33 +02:00
Ulf Hermann 1e0db4577a qmlcachegen: Add hidden --static option
We want qmlcachegen to accept the same arguments as qmlsc so that people
don't have to fiddle with the build system when they need to switch
between them.

Pick-to: 6.7 6.5
Change-Id: If21cbd262104c68c96649b4b0882c079c3862f05
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2024-04-18 14:42:40 +02:00
Joerg Bornemann 107c5da80c Add --warnings-are-errors option to qmlcachegen
[ChangeLog][qmlcachegen] Added the --warnings-are-errors option that
treats warnings as errors when generating C++ code.

Like gcc's -Werror, this option is useful when aiming at warning-free
QML code. Add it to the QT_QMLCACHEGEN_ARGUMENTS target property to
error out once warnings have been encountered.

Change-Id: If72875b33052b37642b18fa192a1344c347990d8
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-12-22 09:50:34 +01:00
Olivier De Cannière 2cf9aeccdd Compiler: Separate function prolog block and add validation of blocks
The function prolog logic is now separated in its own basic block. The
first "real" block with user code starts at offset 0.

Having the function prolog as a hidden part of the first block caused
some inconsistencies in block generation and would create empty blocks.
This happened for example when a back edge of a loop would target offset
0 in code where a loop condition is the very first set of instructions
that are run. This is because the target block offset didn't exist due
to it being part of the hidden prolog block.

Validation for the basic blocks was also added. This checks for three
things at the moment:
1. That return and throw blocks don't have jump targets.
2. That the basic blocks graph is connected.
3. That jump targets are the first offset of a block.

Test tst_QmlCppCodegen::basicBlocksWithBackJump_infinite() is expected
to fail because it contains an infinite loop and the basic blocks that
are generated for it are inconsistent due to dead-code elimination
happening earlier in compilation.

Debug outputs for dumping basic blocks were also adapted to reflect
these changes.

Change-Id: I513f73856412d488d443c2b47a052b0023d45496
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-08-04 09:34:09 +02:00
Ulf Hermann a7c92814f0 qmlcachegen: Add a --verbose command line option
This replaces the logging category magic to determine whether we should
output warnings.

Change-Id: Ibc95ed70227e3438504e921693aa4af9a1d0376e
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-04-24 22:22:13 +02:00
Ulf Hermann ddba87612d QML: Turn singleton/type mismatch into a run time type error
There are many ways to "hide" the qmldir from the engine at run time,
which turns singletons into regular types. While all of this is invalid,
we should not assert on it, but rather produce a legible warning.

Furthermore, sharpen the importing of extra modules from qrc as implicit
imports. We should really only import modules the file in question can
ever be part of. Otherwise we needlessly produce the above situation and
hide legitimate warning messages.

Amends commit 7517c1b3ae.

Now we need to teach our tools about the default import paths in the
resorurce file system. They cannot guess any type they may find in any
resource file anymore.

Pick-to: 6.5
Task-number: QTBUG-106929
Change-Id: Ic8c02396d10830a7f461e8a81649bb8c9a1add1f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
2023-01-27 10:42:06 +01:00
Ulf Hermann bc528a0770 QmlCompiler: Add a separate flag for the "pragma Strict" check
We want to trigger the qFatal() when running qmlcachegen or qmlsc, but
we don't want to trigger it in qmllint, even if we are using the same
QtMsgType for the severity of the messages.

In turn, demote qmlCompiler messages to QtWarningMsg in qmlcachegen.

Pick-to: 6.4
Task-number: QTBUG-107168
Change-Id: Ib660df41742b2d426241eb29ac4c91f4933c5ba1
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-10-20 21:37:57 +02:00
Marc Mutz 958cd3ee10 Port from container::count() and length() to size()
This is a semantic patch using ClangTidyTransformator as in
qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8:

  auto QtContainerClass = anyOf(
      expr(hasType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes))))).bind(o),
      expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o));
  makeRule(cxxMemberCallExpr(on(QtContainerClass),
                             callee(cxxMethodDecl(hasAnyName({"count", "length"),
                                                  parameterCountIs(0))))),
           changeTo(cat(access(o, cat("size"), "()"))),
           cat("use 'size()' instead of 'count()/length()'"))

a.k.a qt-port-to-std-compatible-api with config Scope: 'Container',
with the extended set of container classes recognized.

Change-Id: Idb1f75dfe2323bd1d9e8b4d58d54f1b4b80c7ed7
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-10-07 23:38:48 +02:00
Ulf Hermann 2f583eeab2 Add --bare option to qmltc and qmlcachegen
We need those to prevent usage of the host Qt's import path when
building QML files for the target.

Task-number: QTBUG-106365
Pick-to: 6.4 6.4.0
Change-Id: I34499af850fb759603206cb429ff97633c76054d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-09-09 15:40:40 +02:00
Ivan Solovev 309e2e864f QtDeclarative: port away from deprecated qSetGlobalQHashSeed(0)
Use QHashSeed::setDeterministicGlobalSeed() instead

Task-number: QTBUG-105102
Change-Id: I1d13f3872b335ff9998f7c4538d3b9c3c77fe232
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-08-29 20:48:09 +02:00
Maximilian Goldstein a9038a6cc6 QQmlJSLogger: Switch to an ID based system
This change makes qmljslogger use an ID based system for categorizing
logging entries instead of using an enum. This allows plugins to
register their own logging categories after the fact.

It's also necessary for us to later show the warning ID when
printing warnings and for creating documentation for each ID entry.

Currently not every ID maps cleanly to only one type of warning,
this has to be cleaned up in a follow-up change.

Task-number: QTBUG-103453
Change-Id: I4cac6be7ca165b938e0ea032d077823bf17baf75
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-06-30 11:23:36 +02:00
Lucie Gérard 0dc4fd240a Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.
Files that have to be modified by hand are modified.
License files are organized under LICENSES directory.

Pick-to: 6.4
Task-number: QTBUG-67283
Change-Id: I63563bbeb6f60f89d2c99660400dca7fab78a294
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-06-11 08:05:15 +02:00
Maximilian Goldstein dc6b39fb2e Turn qmlcompiler into a shared library
Converts qmlcompiler into a shared library so it isn't duplicated when
statically linked in tools and so that plugins can link against it.

Change-Id: I91e13cc588796f71a5463dbdce21e42a74120565
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-03-25 13:12:32 +01:00
Ulf Hermann 6ff2669b36 qmlcachegen: Re-enable pragma Strict checking
We've accidentally disabled the pragma Strict check when re-designing
the logging system.

Change-Id: I74cf0d4a45742831037ec0bc0615f1f6a15b7023
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2022-02-18 12:13:47 +01:00
Andrei Golubev 690b7cb6a2 Redesign QQmlJSLogger internals
High-level goal: be able to reuse existing infrastructure
"as is" to configure semantic analysis categories in tools
(qmllint, qmltc, qmlsc, etc.)

To achieve that, simplify the logging to always "log"
something, without explicitly specifying the severity. The
severity is now baked into the category (and we can extend
those to cover different cases)

One slight deviation is the cache generation which likes
to do its own thing at present. Provide a "forced logging"
option where we can specify which severify we want. The
hope is that this gets removed at some point

Particular list of (noteworthy) changes:
* No more "thresholding" by the level (this is rarely needed
  and is actually questionable). Instead, we can ignore a
  particular category explicitly
* Category levels are repurposed as category severities
  (at least from the high-level picture that always should've
  been this way)
* log{Warning,Info,Critical} removed. We use category severity
  instead
* "category error" makes zero sense so removed: if our severity
  is:
  - QtWarningMsg (qmllint), it is already an "error"
  - QtCriticalMsg (compilers), it is already an "error"
* Align m_output and m_{infos,warnings,errors} stored information
* Accept the fact that we don't support QtDebugMsg and QtFatalMsg
* Additional categories added to cover for places where the same
  category would be both an error and not an error

Task-number: QTBUG-100052
Change-Id: I3cd5d17d58be204f48428877bed053f756ac40a8
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2022-02-12 23:21:29 +01:00
Maximilian Goldstein dc9de38abe qmllint: Warn about missing singleton pragmas/qmldir entries
This change adds a warning if we encounter a component marked as a
singleton in a qmldir file which does not contain a pragma
Singleton entry and vice versa.

Note that the warning only gets triggered if the singleton is
actually used.

Fixes: QTBUG-98558
Change-Id: Id7c63f48ba49759c15dffcaee0270c7caab2eb7d
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2022-02-03 11:17:34 +01:00
Ulf Hermann 576fafd1e6 Pass qmldir to qmlcachegen, qmllint and qmltc, not the qmltypes file
The tools will still grudgingly accept qmltypes files being passed via
the -i option. We generally expect qmldir files, though. Ignoring the
qmldir file and importing the qmltypes directly, ignores qmldir imports,
dependencies and other component entries. This leads to unresolvable
types.

[ChangeLog][QML Tooling] qmllint expects qmldir files, not qmltypes
files to be passed via the -i option now. This enables it to see the
imports and dependencies of the module being imported. For backwards
compatibility it still accepts qmltypes files, with a warning.

Pick-to: 6.3
Fixes: QTBUG-99043
Change-Id: I5ed32d7e78df1e604aaf1bfa2ebda09d5d57b628
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-12-13 11:51:13 +00:00
Ulf Hermann 58ff7aa4fe Compile QML files ahead of time with qmlcachegen
qmlcachegen compiles bindings and functions to C++ as far as
QQmlJSAotCompiler can. It does respect "pragma Strict" and rejects the
file if it's violated. Furthermore, it sets up the logger to follow the
qt.qml.compiler.aot logging category. By default it's completely silent.

Compiling the examples with qmlcachegen exposes a bug in the type
resolver where it returns an invalid generic type. It should never do
that. Fix it by returning JSValue.

[ChangeLog][QtQml][Important Behavior Changes] QML bindings and
functions are now compiled to C++ by qmlcachegen, if possible. Use the
qt.qml.compiler.aot logging category to receive diagnostics about the
compilation.

Task-number: QTBUG-98305
Change-Id: I6953812c3fd20b68339617a5714fcbe16a384360
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-12-03 12:09:26 +01:00
Ulf Hermann 06b3f1f2e7 Replace qmlcachegen's --qmljs-runtime with generic mechanism
We don't need --qmljs-runtime after all. However, we do want to pass
custom arguments to qmlcachegen. This way we don't need to change the
world whenever we invent one.

Pick-to: 6.2
Change-Id: I99f0c99c4b15e469605dc43d26871fa43dc36c08
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-06-18 15:41:50 +02:00
Pavol Markovic 1bae74dfa0 qmlcachegen: Fix typo in command line option description
'resource-file-mapping option' is actually using '=' in code and tools

Change-Id: I0d67e13e9d614bf973a0d4332c6b4dcda4c121a4
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-06-12 22:06:07 +12:00
Ulf Hermann 5c4e3c44f7 qmlcachegen: Add an ignored option -I
In other implementations this may be used the same way as qmllint's -I
option, to specify additional import paths.

Change-Id: I447712551ff1fb2a7c379712e938f778b37c514a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-03-04 23:35:16 +01:00
Ulf Hermann 74bf3c8c33 Rework QQmlJSResourceFileMapper
We need more generic filtering capabilities so that it can, for example,
retrieve all the .qml files in a directory, both as qrc paths and local
file paths.

Change-Id: I72a72abc6dd39adb41bcd035f7aa6777e50cb5a5
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2021-02-24 13:01:42 +01:00
Ulf Hermann 1e089ad28d qmlcachegen: Accept both --resource and --resource-path
--resource-path directly specifies the resource path for the file being
compiled and overrides any information we might retrieve from the qrc
file. However, we might still find other relevant information in the qrc
file.

Change-Id: I587c6e4e81f792f62a28b035ee97b33d12eeb06d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-02-23 13:54:33 +01:00
Ulf Hermann 06ab8d790d Add a -i <qmltypes> option to qmlcachegen
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>
2021-01-12 20:58:25 +01:00
Ulf Hermann 9aba23c99e Allow passing --qmljs-runtime to the qmlcachegen implementation
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>
2020-12-02 08:59:12 +01:00
Ulf Hermann 7a7edf14ec Allow passing --direct-calls to the qmlcachegen implementation
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>
2020-12-01 11:20:24 +01:00
Ulf Hermann 8528bd527f qmlcachegen: Move functions to compile QML/JS files to QmlCompiler
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>
2020-10-23 13:31:26 +02:00
Ulf Hermann db13153905 qmlcachegen: Add empty AOT built functions to the loader
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>
2020-10-23 13:31:19 +02:00
Ulf Hermann 2458f07eb5 Move generateloader.cpp to QmlCompiler
We need to be able to generate the loader code from multiple places.

Change-Id: I9e04fd3583b535bc5f7d5fb293cb61309c1e199a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-10-23 13:31:14 +02:00
Ulf Hermann 51f6d418fa qmlcachegen: Move resourcefilter.cpp into QmlCompiler
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>
2020-10-20 17:19:26 +02:00
Ulf Hermann 4f44f82b9f QmlCompiler: Rename ResourceFileMapper
The file class names should start with a common prefix.

Change-Id: I5e014c103668a1bc73d359b00a1dda33e5637a79
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-10-05 14:58:52 +02:00
Ulf Hermann 767dd738d3 Long live libQtQmlCompiler!
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>
2020-10-05 14:58:32 +02:00
Alexandru Croitor 26c5243491 Merge remote-tracking branch 'origin/dev' into wip/cmake
Conflicts:
	dependencies.yaml
	src/qml/qml/qqmlengine.cpp

Change-Id: I6a73fd1064286f4a2232de85c2ce7f80452d4641
2020-03-12 15:03:03 +01:00
Simon Hausmann 8ab237edf1 Restore offset/length in QQmlJS::DiagnosticMessage
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 d4d197d062

Change-Id: Ifb9d344228e3c6e9e26fc4fe112686f9336ea2b2
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-03-02 10:35:50 +01:00
Ulf Hermann cc759804aa Avoid deprecated non-q-prefixed hex() function
Use Qt::hex() instead.

Change-Id: I46bc2f2006ce860cd938a86432783011365c8164
Reviewed-by: Liang Qi <liang.qi@qt.io>
2019-12-17 09:47:15 +01:00
Alexandru Croitor c2f8b9535d Merge remote-tracking branch 'origin/dev' into wip/cmake
Removed dependencies.yaml because we don't use it yet in wip/cmake.
Fixed conflict in qmlcachegen.cpp.

Change-Id: Ie1060c737bee1daa85779903598e5b6d5020d922
2019-10-14 19:02:37 +02:00
Alexandru Croitor 6a0bb9a7d6 Merge remote-tracking branch 'origin/wip/qt6' into wip/cmake
Change-Id: I4a91928610f79c8e21a05781953ffa41508c828a
2019-10-11 16:21:42 +02:00
Qt Forward Merge Bot a510c9c9f4 Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I801567c11fcc3244a1ee7dabeb5079d49fc5c3a1
2019-09-22 22:29:02 +02:00
Simon Hausmann d5f3e7a7e3 Fix regression when using CONFIG+=QtQuickCompiler and .qrc files in subdirs
Commit 41864db3b6 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>
2019-09-19 11:32:23 +02:00
Simon Hausmann 83be211744 Merge remote-tracking branch 'origin/wip/qt6' into dev
Change-Id: I10c4b7fcfa0397d999d45e310c2f8f051d57d4d2
2019-09-19 08:53:00 +02:00
Simon Hausmann 41864db3b6 Fix *.js files disappearing from RESOURCES when not using QtQml
[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>
2019-09-09 07:52:25 +02:00
Ulf Hermann 2746518c76 Merge remote-tracking branch 'origin/dev' into wip/qt6
Conflicts:
	.qmake.conf
	src/qml/qml/qqmlengine.cpp
	src/qmlmodels/qqmlmodelsmodule.cpp

Change-Id: Id60420f8250a9c97fcfe56d4eea19b62c6870404
2019-09-05 11:08:59 +02:00
Tasuku Suzuki 6b106d4463 Fix build without features.temporaryfile
Change-Id: If990efb64a4117bc7624062fededa7ce6a910f14
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-08-19 22:06:26 +09:00
Leander Beernaert 494dc05ea1 Extend qmlcachge to support --retain with CMake
Add missing code so we can use the --retain argument when running
qmlcachgen from a CMake project.

Change-Id: I0b4a2f2ea6c424ba698ee178a332f585271b945e
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-08-13 07:52:51 +00:00
Leander Beernaert 059d792264 Add support for generating qmlcache_loader without qrc
Added support for response file expansion to qmlcachegen.

Add the option --standalone-namespace to qmlcachegen so we can
generate qmlcache_loader from a collection of resource paths
instead of operating on qrc files. This is necessary, since the
namespace identifier is extraced from the qrc file name, which
we no longer have.

This pach was made in order to tend to the cmake port's version of
qtquickcompiler support which does not rely on qrc files.

Change-Id: If15190f3492e6695f5a6e61bf8816998760541f7
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-07-31 12:33:44 +00:00
Simon Hausmann 880a143eb5 Merge remote-tracking branch 'origin/dev' into wip/qt6
Change-Id: I4476733af61fcf3a2af1d121a4585c3fae1c240e
2019-07-12 20:36:48 +02:00
Ulf Hermann f5e4f07841 Disentangle includes and namespaces
Avoid using namespace in headers and include only the headers we
actually need.

Change-Id: I526a0f874dc09b07693fd87070665be396d3b637
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-07-11 11:14:54 +02:00
Ulf Hermann 9a8dd594b5 Merge JSCodeGen and QQmlJSCodeGenerator
Change-Id: I2219cba0dd3782cb2e0b09b8f3c4d5472e6e5d7e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-07-10 18:22:40 +02:00