qtdeclarative/tools
Fawzi Mohamed 6d51f997df Uniformly support shebang
The "qml" tool was the only way of loading QML files that would respect
a shebang line. This is problematic as this way you cannot load such
files programatically using QQmlComponent, limiting their re-use. Common
tools like Qt Creator, but also qmllint, qmlformat, qmlcachegen, etc
would not recognize files with shebangs.

By moving she-bang support directly in the lexer all tools implicitly
support it.
Note that we could just as easily support '#' as extra comment
character along with //, but here we narrowly add support for in
the first line only, as node does (this means that javascript files
using she-bang accepted by node, are now accepted also by qml).

The only tool needing some adjustments is qmlformat, that has to emit
the she-bang again as she-bang and as first line.
Add tests for qmlformat, and sprinkle some she-bangs in the other
tests just to be sure it doesn't affect anything.

Change-Id: I1f6d881c7438bdb23163b5dbe829d59a35d11132
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2021-02-15 18:22:27 +01:00
..
qml Uniformly support shebang 2021-02-15 18:22:27 +01:00
qmlcachegen Remove the qmake project files 2021-01-15 15:34:22 +01:00
qmleasing Remove the qmake project files 2021-01-15 15:34:22 +01:00
qmlformat Uniformly support shebang 2021-02-15 18:22:27 +01:00
qmlimportscanner Use QLibraryInfo::QmlImportsPath rather than Qml2ImportsPath 2021-02-09 21:46:43 +01:00
qmljs Remove the qmake project files 2021-01-15 15:34:22 +01:00
qmllint qmllint: Fix false unknown grouped property warning 2021-02-12 11:57:11 +01:00
qmlplugindump Deprecate qmlplugindump 2021-02-12 11:30:43 +01:00
qmlpreview Remove the qmake project files 2021-01-15 15:34:22 +01:00
qmlprofiler Remove the qmake project files 2021-01-15 15:34:22 +01:00
qmlscene Remove the qmake project files 2021-01-15 15:34:22 +01:00
qmltestrunner Remove the qmake project files 2021-01-15 15:34:22 +01:00
qmltime Use functions as signal handlers when accessing parameters 2021-02-12 10:30:20 +00:00
.prev_CMakeLists.txt CMake: Adjust and regenerate tools project 2020-05-04 18:01:38 +02:00
CMakeLists.txt CMake: Adjust and regenerate tools project 2020-05-04 18:01:38 +02:00