Skip to content

Commit d933347

Browse files
authored
Merge pull request #102 from modelix/docs/metamodel-export
Improve metamodel-export documentation
2 parents 71113c5 + 0dc847a commit d933347

File tree

6 files changed

+295
-8
lines changed

6 files changed

+295
-8
lines changed

docs/global/modules/core/pages/howto/usage-model-api-gen-gradle.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ pluginManagement {
7070
[source,kotlin]
7171
--
7272
plugins {
73-
id("org.modelix.metamodel.gradle")
73+
id("org.modelix.model-api-gen")
7474
}
7575

7676
val mpsVersion: String by rootProject

docs/global/modules/core/pages/reference/component-light-model-client.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
:tip-caption: 🔗 Quick Links
55
[TIP]
66
--
7-
https://artifacts.itemis.cloud/#browse/browse:maven-mps:org%2Fmodelix%2Flight-model-client%2Fmaven-metadata.xml[Nexus^] | https://github.com/modelix/modelix.core[Repository^] | https://github.com/modelix/modelix.core/blob/main/light-model-client/build.gradle.kts[Buildfile^]
7+
https://api.modelix.org/2.3.0/light-model-client/index.html[API doc^] | https://github.com/modelix/modelix.core[Repository^] | https://github.com/modelix/modelix.core/blob/main/light-model-client/build.gradle.kts[buildfile^] | Artifacts: https://artifacts.itemis.cloud/service/rest/repository/browse/maven-mps/org/modelix/light-model-client/[Nexus^] https://github.com/modelix/modelix.core/packages/1787427[GitHub Packages^]
88
--
99

1010

Lines changed: 287 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,289 @@
11
= MPS solution for metamodel-export
22
:navtitle: `metamodel-export` (MPS)
3+
4+
:tip-caption: 🔗 Quick Links
5+
[TIP]
6+
--
7+
https://github.com/modelix/modelix.core[Repository^] | https://github.com/modelix/modelix.core/blob/main/metamodel-export/build.gradle.kts[buildfile^] | Artifacts: https://artifacts.itemis.cloud/service/rest/repository/browse/maven-mps/org/modelix/mps/metamodel-export/[Nexus^] https://github.com/modelix/modelix.core/packages/1834640[GitHub Packages^]
8+
--
9+
10+
== Overview
11+
12+
In order to export a meta-model (i.e. the structure aspect of a langauge) from MPS, modelix uses the MPS solution `metamodel-export`.
13+
This solution maps the structure of a language to corresponding serializable data classes of the https://api.modelix.org/2.3.0/model-api/org.modelix.model.data/index.html[`model-api`] (e.g. `LanguageData` and `ConcepData`).
14+
Further, the `metamodel-expor` provides a command line interface to export these data classes to a JSON file from outside of MPS.
15+
16+
17+
18+
.Unfold to see an exemplary JSON file which is generated from the export
19+
[%collapsible]
20+
====
21+
[,json]
22+
----
23+
{
24+
"uid": "96533389-8d4c-46f2-b150-8d89155f7fca",
25+
"name": "University.Schedule",
26+
"concepts": [
27+
{
28+
"uid": "mps:96533389-8d4c-46f2-b150-8d89155f7fca/4128798754188010560",
29+
"name": "Lecture",
30+
"properties": [
31+
{
32+
"uid": "96533389-8d4c-46f2-b150-8d89155f7fca/4128798754188010560/4128798754188010563",
33+
"name": "description"
34+
},
35+
{
36+
"uid": "96533389-8d4c-46f2-b150-8d89155f7fca/4128798754188010560/4128798754188010565",
37+
"name": "maxParticipants",
38+
"type": "INT"
39+
}
40+
],
41+
"children": [
42+
{
43+
"uid": "96533389-8d4c-46f2-b150-8d89155f7fca/4128798754188010560/4128798754188058355",
44+
"name": "schedule",
45+
"type": "University.Schedule.Schedule",
46+
"optional": false
47+
}
48+
],
49+
"references": [
50+
{
51+
"uid": "96533389-8d4c-46f2-b150-8d89155f7fca/4128798754188010560/4128798754188058364",
52+
"name": "room",
53+
"type": "University.Schedule.Room",
54+
"optional": false
55+
}
56+
],
57+
"extends": [
58+
"jetbrains.mps.lang.core.BaseConcept",
59+
"jetbrains.mps.lang.core.INamedConcept"
60+
]
61+
},
62+
{
63+
"uid": "mps:96533389-8d4c-46f2-b150-8d89155f7fca/4128798754188010568",
64+
"name": "Schedule",
65+
"abstract": true,
66+
"properties": [
67+
],
68+
"children": [
69+
{
70+
"uid": "96533389-8d4c-46f2-b150-8d89155f7fca/4128798754188010568/4128798754188010578",
71+
"name": "at",
72+
"type": "University.Schedule.DateAndTime",
73+
"optional": false
74+
}
75+
],
76+
"references": [
77+
],
78+
"extends": [
79+
"jetbrains.mps.lang.core.BaseConcept"
80+
]
81+
},
82+
{
83+
"uid": "mps:96533389-8d4c-46f2-b150-8d89155f7fca/4128798754188010569",
84+
"name": "Recurring",
85+
"properties": [
86+
],
87+
"children": [
88+
],
89+
"references": [
90+
],
91+
"extends": [
92+
"University.Schedule.Schedule"
93+
]
94+
},
95+
{
96+
"uid": "mps:96533389-8d4c-46f2-b150-8d89155f7fca/4128798754188010570",
97+
"name": "DateAndTime",
98+
"properties": [
99+
{
100+
"uid": "96533389-8d4c-46f2-b150-8d89155f7fca/4128798754188010570/4128798754188010571",
101+
"name": "date"
102+
},
103+
{
104+
"uid": "96533389-8d4c-46f2-b150-8d89155f7fca/4128798754188010570/4128798754188010573",
105+
"name": "time"
106+
}
107+
],
108+
"children": [
109+
],
110+
"references": [
111+
],
112+
"extends": [
113+
"jetbrains.mps.lang.core.BaseConcept"
114+
]
115+
},
116+
{
117+
"uid": "mps:96533389-8d4c-46f2-b150-8d89155f7fca/4128798754188010580",
118+
"name": "Room",
119+
"properties": [
120+
{
121+
"uid": "96533389-8d4c-46f2-b150-8d89155f7fca/4128798754188010580/4128798754188010583",
122+
"name": "maxPlaces",
123+
"type": "INT"
124+
},
125+
{
126+
"uid": "96533389-8d4c-46f2-b150-8d89155f7fca/4128798754188010580/4128798754188010585",
127+
"name": "hasRemoteEquipment",
128+
"type": "BOOLEAN"
129+
}
130+
],
131+
"children": [
132+
],
133+
"references": [
134+
],
135+
"extends": [
136+
"jetbrains.mps.lang.core.BaseConcept",
137+
"jetbrains.mps.lang.core.INamedConcept"
138+
]
139+
},
140+
{
141+
"uid": "mps:96533389-8d4c-46f2-b150-8d89155f7fca/4128798754188010588",
142+
"name": "Rooms",
143+
"properties": [
144+
],
145+
"children": [
146+
{
147+
"uid": "96533389-8d4c-46f2-b150-8d89155f7fca/4128798754188010588/4128798754188010589",
148+
"name": "rooms",
149+
"type": "University.Schedule.Room",
150+
"multiple": true
151+
}
152+
],
153+
"references": [
154+
],
155+
"extends": [
156+
"jetbrains.mps.lang.core.BaseConcept"
157+
]
158+
},
159+
{
160+
"uid": "mps:96533389-8d4c-46f2-b150-8d89155f7fca/4128798754188057192",
161+
"name": "Courses",
162+
"properties": [
163+
],
164+
"children": [
165+
{
166+
"uid": "96533389-8d4c-46f2-b150-8d89155f7fca/4128798754188057192/4128798754188057193",
167+
"name": "lectures",
168+
"type": "University.Schedule.Lecture",
169+
"multiple": true
170+
}
171+
],
172+
"references": [
173+
],
174+
"extends": [
175+
"jetbrains.mps.lang.core.BaseConcept"
176+
]
177+
},
178+
{
179+
"uid": "mps:96533389-8d4c-46f2-b150-8d89155f7fca/4128798754188059567",
180+
"name": "OneOff",
181+
"properties": [
182+
],
183+
"children": [
184+
],
185+
"references": [
186+
],
187+
"extends": [
188+
"University.Schedule.Schedule"
189+
]
190+
},
191+
{
192+
"uid": "mps:96533389-8d4c-46f2-b150-8d89155f7fca/1648392019017048449",
193+
"name": "Student",
194+
"properties": [
195+
{
196+
"uid": "96533389-8d4c-46f2-b150-8d89155f7fca/1648392019017048449/1648392019017048450",
197+
"name": "name"
198+
},
199+
{
200+
"uid": "96533389-8d4c-46f2-b150-8d89155f7fca/1648392019017048449/1648392019017048454",
201+
"name": "semester",
202+
"type": "INT"
203+
}
204+
],
205+
"children": [
206+
{
207+
"uid": "96533389-8d4c-46f2-b150-8d89155f7fca/1648392019017048449/1648392019017048452",
208+
"name": "born",
209+
"type": "University.Schedule.DateAndTime",
210+
"optional": false
211+
}
212+
],
213+
"references": [
214+
],
215+
"extends": [
216+
"jetbrains.mps.lang.core.BaseConcept"
217+
]
218+
},
219+
{
220+
"uid": "mps:96533389-8d4c-46f2-b150-8d89155f7fca/1648392019017048457",
221+
"name": "Students",
222+
"properties": [
223+
],
224+
"children": [
225+
{
226+
"uid": "96533389-8d4c-46f2-b150-8d89155f7fca/1648392019017048457/1648392019017048458",
227+
"name": "students",
228+
"type": "University.Schedule.Student",
229+
"multiple": true
230+
}
231+
],
232+
"references": [
233+
],
234+
"extends": [
235+
"jetbrains.mps.lang.core.BaseConcept"
236+
]
237+
},
238+
{
239+
"uid": "mps:96533389-8d4c-46f2-b150-8d89155f7fca/1648392019017048460",
240+
"name": "LectureAssignments",
241+
"properties": [
242+
],
243+
"children": [
244+
{
245+
"uid": "96533389-8d4c-46f2-b150-8d89155f7fca/1648392019017048460/1648392019017048466",
246+
"name": "lectures",
247+
"type": "University.Schedule.Assignment",
248+
"multiple": true
249+
}
250+
],
251+
"references": [
252+
{
253+
"uid": "96533389-8d4c-46f2-b150-8d89155f7fca/1648392019017048460/1648392019017048461",
254+
"name": "student",
255+
"type": "University.Schedule.Student",
256+
"optional": false
257+
}
258+
],
259+
"extends": [
260+
"jetbrains.mps.lang.core.BaseConcept"
261+
]
262+
},
263+
{
264+
"uid": "mps:96533389-8d4c-46f2-b150-8d89155f7fca/1648392019017048463",
265+
"name": "Assignment",
266+
"properties": [
267+
],
268+
"children": [
269+
],
270+
"references": [
271+
{
272+
"uid": "96533389-8d4c-46f2-b150-8d89155f7fca/1648392019017048463/1648392019017048464",
273+
"name": "lecture",
274+
"type": "University.Schedule.Lecture",
275+
"optional": false
276+
}
277+
],
278+
"extends": [
279+
"jetbrains.mps.lang.core.BaseConcept"
280+
]
281+
}
282+
]
283+
}
284+
----
285+
====
286+
287+
288+
The `metamodel-export` is primarily intended to be used by the xref:core:reference/component-model-api-gen.adoc[].
289+

docs/global/modules/core/pages/reference/component-model-api-gen-gradle.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
:tip-caption: 🔗 Quick Links
66
[TIP]
77
--
8-
https://artifacts.itemis.cloud/#browse/browse:maven-mps:org%2Fmodelix%2Fmodel-api-gen%2Fmaven-metadata.xml[Nexus^] | https://github.com/modelix/modelix.core[Repository^] | https://github.com/modelix/modelix.core/blob/main/model-api-gen-gradle/build.gradle.kts[Buildfile^]
8+
https://api.modelix.org/2.3.0/model-api-gen-gradle/index.html[API doc^] | https://github.com/modelix/modelix.core[Repository^] | https://github.com/modelix/modelix.core/blob/main/model-api-gen-gradle/build.gradle.kts[buildfile^] | Artifacts: https://artifacts.itemis.cloud/service/rest/repository/browse/maven-mps/org/modelix/model-api-gen-gradle/[Nexus^] https://github.com/modelix/modelix.core/packages/1834773[GitHub Packages^]
99
--
1010

1111
== Overview
12-
The `model-api-gen.gradle.plugin` is a Gradle plugin that wraps the functionality of xref:core:reference/component-model-api-gen.adoc[model-api-gen].
12+
The `model-api-gen.gradle.plugin` is a Gradle plugin that wraps the functionality of the xref:core:reference/component-metamodel-export.adoc[] and xref:core:reference/component-model-api-gen.adoc[].
1313
It provides an additional Gradle task which will apply a 2-staged process:
1414

1515
. MPS metamodel export to JSON (optional)
@@ -26,7 +26,7 @@ metamodel {
2626
jsonDir = File("path/to/json/dir")
2727
}
2828
--
29-
As a result, all MPS-specific configuration settings will be ignored and the specified directory will be used for the next step.
29+
As a result, all MPS-specific configuration settings will be ignored and the specified directory will be used for the next step.
3030

3131
. JSON to model API generation
3232
+
@@ -195,4 +195,4 @@ metamodel {
195195
languageClass.suffix = "MyLanguageSuffix"
196196
}
197197
}
198-
--
198+
--

docs/global/modules/core/pages/reference/component-model-api-gen.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
:tip-caption: 🔗 Quick Links
66
[TIP]
77
--
8-
https://artifacts.itemis.cloud/#browse/browse:maven-mps:org%2Fmodelix%2Fmodel-api-gen%2Fmaven-metadata.xml[Nexus^] | https://github.com/modelix/modelix.core[Repository^] | https://github.com/modelix/modelix.core/blob/main/model-api-gen/build.gradle.kts[Buildfile^]
8+
https://api.modelix.org/2.3.0/model-api-gen/index.html[API doc^] | https://github.com/modelix/modelix.core[Repository^] | https://github.com/modelix/modelix.core/blob/main/model-api-gen/build.gradle.kts[buildfile^] | Artifacts: https://artifacts.itemis.cloud/service/rest/repository/browse/maven-mps/org/modelix/model-api-gen/[Nexus^] https://github.com/modelix/modelix.core/packages/1834770[GitHub Packages^]
99
--
1010

1111

docs/global/modules/core/pages/reference/component-model-server.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
:tip-caption: 🔗 Quick Links
55
[TIP]
66
--
7-
https://artifacts.itemis.cloud/#browse/browse:maven-mps:org%2Fmodelix%2Fmodel-server%2Fmaven-metadata.xml[Nexus^] | https://github.com/modelix/modelix.core[Repository^] | https://github.com/modelix/modelix.core/blob/main/model-server/build.gradle.kts[Buildfile^]
7+
https://api.modelix.org/2.3.0/model-server/index.html[API doc^] | https://github.com/modelix/modelix.core[Repository^] | https://github.com/modelix/modelix.core/blob/main/model-server/build.gradle.kts[buildfile^] | Artifacts: https://artifacts.itemis.cloud/service/rest/repository/browse/maven-mps/org/modelix/model-server[Nexus^] https://github.com/modelix/modelix/packages/1077342[GitHub Packages^]
88
--
99

1010

0 commit comments

Comments
 (0)