Changes
Page history
[Developer] Add section about writing to the FS
authored
Jan 15, 2019
by
Rico Bergmann
Show whitespace changes
Inline
Side-by-side
asciidoc/Developer-documentation.asciidoc
View page @
3f546547
...
...
@@ -198,3 +198,16 @@ not generated automatically. Thus they need to be added to the JAR manually.
NOTE: Generating these classes is currently being worked on.
== Writing to the File system [[compilation]]
The process of compiling and packaging an `SModel` is pretty straightforward: all `SClasses` need
to be written to the file system. Afterwards the Scala compiler may be invoked and the resulting
byte-code files will be put into a JAR-file.
For executing this workflow a visitor will be used once again. The `SModelFSWriter` will write each
`SClass` to the file system upon each `visit`. Once the whole `SModel` is being visited, the visitor
knows it is done and starts compilation as well as packaging. During this step, other resources
such as the model diagram images will be copied as well.
Although the general steps are quite simple, some details do introduce difficulties. Namely copying
files into a JAR may only be done by streaming the data into the JAR. Furthermore setting up the
compiler requires the classpath to be adapted to the current environment.