|
|
= User documentation
|
|
|
:sectanchors:
|
|
|
:sectlinks:
|
|
|
|
|
|
If you want to find out how to convert your own EMF models to Scala code that is ready to be used in
|
|
|
a _Synchronization context_, this page is for you.
|
|
|
|
|
|
== Building the generator
|
|
|
|
|
|
The generator is build using https://www.scala-sbt.org/[sbt]. To run it, it is recommend to generate
|
|
|
an executable _JAR_ first.
|
|
|
|
|
|
The following commands should get you started as quick as possible:
|
|
|
|
|
|
[source, shell]
|
|
|
----
|
|
|
$ git clone --recurse-submodules https://git-st.inf.tu-dresden.de/cwerner/code_generator.git
|
|
|
$ cd code_generator
|
|
|
$ sbt assembly
|
|
|
----
|
|
|
|
|
|
The resulting _JAR_ can than be found at `/target/scala-2.12/CodeGenerator-assembly-X.Y.jar` (make
|
|
|
sure to substitute `X.Y` with your version number). It may simply be invoked using the `java -jar`
|
|
|
command (see <<running>> for details).
|
|
|
|
|
|
== Running the generator [[running]]
|
|
|
|
|
|
Currently the generator is supposed to be run as a command line utility. It expects the path to an
|
|
|
`ecore` model as required argument. All other parameters are optional.
|
|
|
|
|
|
You can call the generator like this: `java -jar generator.jar _[ARGS]_ _ECORE_`. The following
|
|
|
arguments are supported:
|
|
|
|
|
|
.Generator arguments
|
|
|
|===
|
|
|
|Argument |Long | Parameter |Meaning
|
|
|
|
|
|
|`-c`
|
|
|
|`--cleanup`
|
|
|
|<__none__>
|
|
|
|will exclude the generated `.scala` files from being added to the _JAR_ and remove them after the
|
|
|
compilation is done.
|
|
|
|
|
|
|`-o`
|
|
|
|`--outdir`
|
|
|
|_OPATH_
|
|
|
|will write the generated `model.jar` to the directory specified by _OPATH_. If this parameter is
|
|
|
omitted, the current directory will be used.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|_ECORE_
|
|
|
|the path to the ecore XML-file which contains the model.
|
|
|
|
|
|
|===
|
|
|
|
|
|
== Supported EMF features
|
|
|
|
|
|
=== Implemented
|
|
|
|
|
|
- [x] Generation of classes according to its `EAttributes`
|
|
|
- [x] Traversal of inheritance hierarchies and generation of matching code (this does not include
|
|
|
multiple inheritance yet)
|
|
|
|
|
|
=== Not yet implemented
|
|
|
|
|
|
- [ ] Re-use of methods with attached implementation in the generated code (currently all methods
|
|
|
in the EMF will be discarded)
|
|
|
- [ ] Generation of `final` attributes
|
|
|
- [ ] Resolution of (containment) references as attributes
|
|
|
- [ ] Resolution of inheritance hierarchies that utilize multiple inheritance
|
|
|
|
|
|
== Known bugs
|
|
|
|
|
|
_None_ yet. |