-
Notifications
You must be signed in to change notification settings - Fork 0
/
dml-generate.xml
52 lines (48 loc) · 2.33 KB
/
dml-generate.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<project>
<!-- the name of the class that should be created to represent a DomainModel -->
<property name="fenix.framework.domainModelClass" value="pt.ist.fenixframework.pstm.dml.FenixDomainModel"/>
<!-- the name of the class that should be used to generate code from the DML -->
<!-- <property name="fenix.framework.codeGenerator" value="pt.ist.fenixframework.pstm.dml.FenixCodeGenerator"/> -->
<property name="fenix.framework.codeGenerator" value="pt.ist.fenixframework.pstm.dml.FenixCodeGeneratorOneBoxPerObject"/>
<!-- <property name="fenix.framework.codeGenerator" value="pt.ist.fenixframework.example.tpcw.dml.TPCWHibernateOGMCodeGenerator"/> -->
<macrodef name="dml-compile"
description="Generates the domain model from a source DML Language file">
<attribute name="codeGenerator" description="The code generator to use" default="${fenix.framework.codeGenerator}"/>
<attribute name="dml" description="DML source file" />
<attribute name="java-sources" description="Directory of domain objects" />
<attribute name="java-gen" description="Directory of the generated base domain objects" />
<element name="elements" implicit="true" />
<sequential>
<mkdir dir="@{java-gen}" />
<java classname="dml.DmlCompiler" fork="true">
<arg value="-d" />
<arg value="@{java-sources}" />
<arg value="-db" />
<arg value="@{java-gen}" />
<arg value="-domainModelClass" />
<arg value="${fenix.framework.domainModelClass}" />
<arg value="-generator" />
<arg value="@{codeGenerator}" />
<arg value="@{dml}" />
<elements />
</java>
</sequential>
</macrodef>
<macrodef name="post-process-domain"
description="Post process the domain classes generated by the DML compiler">
<attribute name="dml" description="DML source file" />
<attribute name="dir" description="Directory where files reside" />
<element name="elements" implicit="true" />
<sequential>
<java classname="pt.ist.fenixframework.pstm.PostProcessDomainClasses"
dir="@{dir}"
fork="true">
<arg value="-domainModelClass"/>
<arg value="${fenix.framework.domainModelClass}"/>
<arg value="-d"/>
<arg value="@{dml}"/>
<elements />
</java>
</sequential>
</macrodef>
</project>