Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: Build (macOS)
on:
push:
branches: [main, dev]
pull_request:
branches: [main]

jobs:
build:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: Build (Ubuntu)
on:
push:
branches: [main, dev]
pull_request:
branches: [main]

jobs:
build:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: 🐳 Docker Build
on:
push:
branches: [main, dev, testCI]
pull_request:
branches: [main]

jobs:

Expand Down
1 change: 1 addition & 0 deletions src/xml_chunks.ml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ let xml_header = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><XMI xmlns:UML=\"hre
<XMI.exporter>PlantUML</XMI.exporter>
<XMI.exporterVersion>1.2024.7</XMI.exporterVersion>
<XMI.creator>puml2xml</XMI.creator>
<XMI.creatorVersion>1.2.0</XMI.creatorVersion>
</XMI.documentation>
<XMI.metamodel xmi.name=\"UML\" xmi.version=\"1.4\"/>
</XMI.header>
Expand Down
28 changes: 18 additions & 10 deletions src/xml_gen.ml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,22 @@ let feature_to_xml feature =
feature.visibility
feature.id

let get_formatted_features features =
features
|> List.sort (fun f1 f2 ->
match f1.feature_type, f2.feature_type with
| Attribute, Method -> -1
| Method, Attribute -> 1
| _ -> 0)
|> List.fold_left (fun acc f -> acc ^ "\n" ^ indent 4 ^ feature_to_xml f) ""

let class_to_xml uml_class =
let features_xml = List.fold_left (fun acc f ->
acc ^ "\n" ^ indent 4 ^ feature_to_xml f) "" uml_class.features in
Printf.sprintf "%s<UML:Class name=\"%s\" xmi.id=\"%s\">\n%s<UML:Classifier.feature>%s\n%s</UML:Classifier.feature>\n%s</UML:Class>"
(indent 4)
uml_class.name
uml_class.id
(indent 5)
features_xml
(indent 5)
(indent 4)
let features_xml = get_formatted_features uml_class.features in
Printf.sprintf "%s<UML:Class name=\"%s\" xmi.id=\"%s\">\n%s<UML:Classifier.feature>%s\n%s</UML:Classifier.feature>\n%s</UML:Class>"
(indent 4)
uml_class.name
uml_class.id
(indent 5)
features_xml
(indent 5)
(indent 4)