summaryrefslogtreecommitdiff
path: root/src/ivicore
diff options
context:
space:
mode:
authorDominik Holland <dominik.holland@qt.io>2019-10-11 16:22:41 +0200
committerDominik Holland <dominik.holland@qt.io>2019-10-30 12:08:31 +0100
commit94e15d1212bace7745fe3e4599cb34c4260fd277 (patch)
treebd3a03bfaf51f1df2ebd680601dbf6f11d5fed2a /src/ivicore
parent3e87fc47a02138b7424f30392495408b57cca6ce (diff)
downloadqtivi-94e15d1212bace7745fe3e4599cb34c4260fd277.tar.gz
ivigenerator: Use the rule YAML format from QFace 2.0
QFace 2.0 introduced a rule YAML format similar to the YAML format the ivigenerator uses to define how the files are supposed to be generated. This change ports all our existing templates to the new YAML format and deprecates the old one, but still supports it. Fixes: AUTOSUITE-1299 Change-Id: I1fd4ec0e2ed1a0953726b0d7472ab6b9d0574786 Reviewed-by: Robert Griebl <robert.griebl@qt.io>
Diffstat (limited to 'src/ivicore')
-rw-r--r--src/ivicore/doc/src/external-resources.qdoc5
-rw-r--r--src/ivicore/doc/src/ivigenerator/generator-usage.qdoc30
-rw-r--r--src/ivicore/doc/src/ivigenerator/ivigenerator.qdoc2
3 files changed, 21 insertions, 16 deletions
diff --git a/src/ivicore/doc/src/external-resources.qdoc b/src/ivicore/doc/src/external-resources.qdoc
index 6541ff5..6e1911f 100644
--- a/src/ivicore/doc/src/external-resources.qdoc
+++ b/src/ivicore/doc/src/external-resources.qdoc
@@ -34,3 +34,8 @@
\externalpage https://doc.qt.io/qt-5/qabstractlistmodel.html#subclassing
\title QAbstractListModel - Subclassing
*/
+
+/*!
+ \externalpage https://qface.readthedocs.io/en/latest/extending.html#rule-base-generation
+ \title QFace - Rule Base Generation
+*/
diff --git a/src/ivicore/doc/src/ivigenerator/generator-usage.qdoc b/src/ivicore/doc/src/ivigenerator/generator-usage.qdoc
index 287dc99..7d870d9 100644
--- a/src/ivicore/doc/src/ivigenerator/generator-usage.qdoc
+++ b/src/ivicore/doc/src/ivigenerator/generator-usage.qdoc
@@ -153,23 +153,25 @@
This YAML file must have the following structure:
\code
- generate_rules:
- module_rules:
- - dest_file: "{{module.module_name|lower}}plugin.h"
- template_file: "plugin.h.tpl"
- interface_rules:
- - dest_file: '{{interface|lower}}backend.h'
- template_file: 'backend.h.tpl'
- struct_rules:
+ frontend:
+ module:
+ documents:
+ - "{{module.module_name|lower}}plugin.h": "plugin.h.tpl"
+ interface:
+ documents:
+ - '{{interface|lower}}backend.h': 'backend.h.tpl'
\endcode
For every entity, there's a list of templates that must be called, when traversing this entity
- in the domain model tree. Here, \e{dest_file} is a name of the file that needs to be created,
- as specified in the \l {Jinja template syntax}{Jinja template language} format. The value of
- the object property used in the template's name is processed and substituted into the template,
- thus forming the final name of the file to create. \e{dest_file} is the name of the template to
- use. For the IVI generator, you must specify rules for three kinds of entities: modules,
- interfaces and structures.
+ in the domain model tree. Here, the YAML file defines a list of documents, which need to be
+ generated for all modules and a list for all interfaces. Every list entry consists of two
+ parts; the first part is the name of the file that needs to be created, as specified in the \l
+ {Jinja template syntax}{Jinja template language} format. The value of the object property used
+ in the template's name is processed and substituted into the template, thus forming the final
+ name of the file to create. The second part is the name of the template to use. For the IVI
+ generator, you must specify rules for three kinds of entities: modules, interfaces and
+ structures. See the \l{QFace - Rule Base Generation}{QFace Rule Base Generation Documentation}
+ for more information.
\section2 Annotations YAML
diff --git a/src/ivicore/doc/src/ivigenerator/ivigenerator.qdoc b/src/ivicore/doc/src/ivigenerator/ivigenerator.qdoc
index 5ff1c97..b174b43 100644
--- a/src/ivicore/doc/src/ivigenerator/ivigenerator.qdoc
+++ b/src/ivicore/doc/src/ivigenerator/ivigenerator.qdoc
@@ -54,8 +54,6 @@ Currently, Qt IVI generator has the following limitations:
QGeoCoordinate inside a QFace IDL.
\li The \c map<> type is not supported.
\li Any default values provided directly in the QFace file are currently ignored.
- \li The \c ivigenerator uses it's own YAML template, that's incorporated with QFace's YAML to
- define the generation rules.
\endlist
*/