1
|
1 |
<?xml version="1.0" encoding="UTF-8"?>
|
|
2 |
<project default="codegen" basedir="..">
|
|
3 |
<dirname property="antfile.dir" file="${ant.file}"/>
|
|
4 |
|
|
5 |
<!-- Global properties -->
|
|
6 |
<property name="main.directory" location="${antfile.dir}/.."/>
|
|
7 |
<property name="output.directory" location="${main.directory}"/>
|
|
8 |
<property name="source.directory" value="src"/>
|
|
9 |
<property name="genJDKLevel" value="5.0"/>
|
|
10 |
|
|
11 |
<target name="codegen">
|
|
12 |
|
|
13 |
<!-- A macrodef makes it easier to generate code for multiple models in one script. -->
|
|
14 |
<macrodef name="multipleXSDs2Java">
|
|
15 |
<attribute name="genModelName"/>
|
|
16 |
<element name="settings"/>
|
|
17 |
<sequential>
|
|
18 |
<emf.XSD2Java
|
|
19 |
genModel="${output.directory}/emf/@{genModelName}.genmodel"
|
|
20 |
modelProject="${output.directory}"
|
|
21 |
modelProjectFragmentPath="${source.directory}"
|
|
22 |
modelPluginID="@{genModelName}.model"
|
|
23 |
copyright="This is my code."
|
|
24 |
jdkLevel="${genJDKLevel}">
|
|
25 |
<settings/>
|
|
26 |
</emf.XSD2Java>
|
|
27 |
</sequential>
|
|
28 |
</macrodef>
|
|
29 |
|
|
30 |
<!-- Generating the code for the library model -->
|
|
31 |
<multipleXSDs2Java genModelName="library">
|
|
32 |
<settings>
|
|
33 |
<model file="${main.directory}/model/libraryPart1.xsd"/>
|
|
34 |
<model file="${main.directory}/model/libraryPart2.xsd"/>
|
|
35 |
<arg line="-packages http://www.example.eclipse.org/Library1"/>
|
|
36 |
<arg line="-packages http://www.example.eclipse.org/Library2"/>
|
|
37 |
<arg line="-packageMap http://www.example.eclipse.org/Library1 org.examples.library.elements"/>
|
|
38 |
<arg line="-packageMap http://www.example.eclipse.org/Library2 org.examples.library"/>
|
|
39 |
</settings>
|
|
40 |
</multipleXSDs2Java>
|
|
41 |
|
|
42 |
</target>
|
|
43 |
</project> |