-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
225 lines (204 loc) · 9.45 KB
/
build.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- WARNING: Eclipse auto-generated file.
Any modifications will be overwritten.
To include a user specific buildfile here, simply create one in the same
directory with the processing instruction <?eclipse.ant.import?>
as the first entry and export the buildfile again. -->
<project basedir="." default="all" name="xmi">
<!-- property are variable -->
<property environment="env"/>
<property name="ECLIPSE_HOME" value="../../../eclipse/eclipse-neon/"/>
<property name="debuglevel" value="source,lines,vars"/>
<property name="target" value="1.8"/>
<property name="source" value="1.8"/>
<property name="dir.buildfile" value="."/>
<property name="myjargenerator" value="generator.uml.jpa.jar"/>
<property name="dir.root" value="./"/>
<property name="mygenpegasev1jar" value="example/pegase_v1/model.gen.pegase_v1.jar"/>
<property name="mygentest1jar" value="example/test1/model.gen.test1.jar"/>
<property name="mygentest3jar" value="example/test3/model.gen.test3.jar"/>
<property name="mygentest4jar" value="example/test4/model.gen.test4.jar"/>
<!-- path location point library are use by a target,
the path id is the id use in target to know which library are used by the target
optimisation possible par include lib/*.jar-->
<path id="xmi.classpath">
<pathelement location="bin"/>
<pathelement location="lib/dom4j-1.4.jar"/>
<pathelement location="lib/jaxen-core.jar"/>
<pathelement location="lib/jaxen-jdom.jar"/>
<pathelement location="lib/jdom.jar"/>
<pathelement location="lib/junit-3.8.1.jar"/>
<pathelement location="lib/log4j-1.2.8.jar"/>
<pathelement location="lib/test-framework.jar"/>
<pathelement location="lib/org.eclipse.emf.common-2.12.0.jar"/>
<pathelement location="lib/org.eclipse.uml2.uml-5.0.1.v20140910-1354.jar"/>
<pathelement location="lib/org.eclipse.emf.ecore.xmi-2.12.0.jar"/>
<pathelement location="lib/types-2.0.0-v20140602-0749.jar"/>
<pathelement location="lib/org.eclipse.uml2.common-2.0.1.v20140910-1354.jar"/>
<pathelement location="lib/exporter-2.3.0-v200706262000.jar"/>
<pathelement location="lib/converter-2.3.0-v200706262000.jar"/>
<pathelement location="lib/org.eclipse.emf.codegen.ecore-2.12.0.jar"/>
<pathelement location="lib/org.eclipse.emf.ecore-2.12.0.jar"/>
<pathelement location="lib/resources-4.1.0-v20130902-0826.jar"/>
<pathelement location="lib/epsilon-emf-1.4.0.jar"/>
<pathelement location="lib/epsilon-core-1.4.0.jar"/>
<pathelement location="lib/l2-1.1.0-v20140202-2055.jar"/>
<pathelement location="lib/l3-1.1.0-v20140202-2055.jar"/>
<pathelement location="lib/ecore2xml-2.3.0-v200706262000.jar"/>
<pathelement location="lib/epsilon-uml-1.4.0.jar"/>
<pathelement location="lib/args4j-2.33.jar"/>
</path>
<path id="gen.classpath"> <!-- this jar are used to generate the output-file.jar of the uml2jpa project -->
<pathelement location="example/libgen/validation-api-2.0.1.Final.jar" />
<pathelement location="example/libgen/jenabean-1.0.6.jar" />
<pathelement location="example/libgen/jena-2.6.2.jar" />
<pathelement location="example/libgen/arq-2.8.2.jar" />
<pathelement location="example/libgen/xref_util.jar" />
</path>
<target name="init">
<mkdir dir="bin"/>
<copy includeemptydirs="false" todir="bin">
<fileset dir="src">
<exclude name="**/*.launch"/>
<exclude name="**/*.java"/>
</fileset>
</copy>
</target>
<target depends="init" name="build-project">
<echo message="build-project: ${ant.project.name}: ${ant.file}"/>
<javac debug="true" debuglevel="${debuglevel}" destdir="bin" includeantruntime="false" source="${source}" target="${target}">
<src path="src"/>
<classpath refid="xmi.classpath"/>
</javac>
</target>
<target name="create_generator_jar" depends="build-project">
<echo >
going to create ${dir.root}/${myjargenerator}
</echo>
<jar destfile="${dir.root}/${myjargenerator}" filesetmanifest="mergewithoutmain">
<manifest>
<attribute name="Main-Class" value="generator.GenerateJPAapp"/>
<attribute name="Class-Path" value="."/>
</manifest>
<fileset dir="${dir.root}/bin"/>
</jar>
</target>
<!-- adds Eclipse .jar to ant -->
<target description="copy Eclipse compiler jars to ant lib directory" name="init-eclipse-compiler">
<copy todir="${ant.library.dir}">
<fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
</copy>
<unzip dest="${ant.library.dir}">
<patternset includes="jdtCompilerAdapter.jar"/>
<fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
</unzip>
</target>
<!-- call build target with eclipse compilier -->
<target description="compile project with Eclipse compiler" name="build-eclipse-compiler">
<property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
<antcall target="all"/>
</target>
<target name="create_gen_pegase_v1_jar">
<echo >
going to generate ${mygenpegasev1jar}
</echo>
<delete file="${mygenpegasev1jar}" />
<mkdir dir="example/pegase_v1/bin"/>
<exec executable="rm" >
<arg line=" -f example/pegase_v1/bin/*" />
</exec>
<exec executable="rm" >
<arg line=" -f example/pegase_v1/gen/*" />
</exec>
<exec executable="bash" >
<arg line="generate_PEGASE_V1.sh" />
</exec>
<exec executable="ls" >
<arg line="-Rl example/pegase_v1/gen/" />
</exec>
<javac debug="true" debuglevel="${debuglevel}"
destdir="example/pegase_v1/bin/"
includeantruntime="false"
source="${source}" target="${target}">
<src path="example/pegase_v1/gen/"/>
<classpath refid="xmi.classpath"/>
<classpath refid="gen.classpath"/>
</javac>
<exec executable="ls" >
<arg line="-Rl example/pegase_v1/bin/" />
</exec>
<jar destfile="${mygenpegasev1jar}" filesetmanifest="mergewithoutmain">
<fileset dir="example/pegase_v1/bin"/>
</jar>
</target>
<!-- create a file.class with file.java and create a jar file in test1 and archive file.class inside-->
<target name="create_gen_test1_jar"> <!-- some trouble with redondance -->
<echo >
going to generate ${mygentest1jar}
</echo>
<mkdir dir="example/test1/bin"/>
<javac debug="true" debuglevel="${debuglevel}" destdir="example/test1/bin" includeantruntime="false"
source="${source}" target="${target}">
<src path="example/test1/gen"/>
<classpath refid="xmi.classpath"/>
<classpath refid="gen.classpath"/>
</javac>
<jar destfile="${mygentest1jar}" filesetmanifest="mergewithoutmain">
<fileset dir="example/test1/bin"/>
</jar>
</target>
<!-- create a file.class with file.java and create a jar file in test1 and archive file.class inside-->
<target name="create_gen_test3_jar"> <!-- some trouble with redondance -->
<echo >
going to generate ${mygentest3jar}
</echo>
<mkdir dir="example/test3/bin"/>
<javac debug="true" debuglevel="${debuglevel}" destdir="example/test3/bin" includeantruntime="false"
source="${source}" target="${target}">
<src path="example/test3/gen"/>
<classpath refid="xmi.classpath"/>
<classpath refid="gen.classpath"/>
</javac>
<jar destfile="${mygentest3jar}" filesetmanifest="mergewithoutmain">
<fileset dir="example/test3/bin"/>
</jar>
</target>
<!-- create a file.class with file.java and create a jar file in test1 and archive file.class inside-->
<target name="create_gen_inra_dev_test_jar"> <!-- some trouble with redondance -->
<echo >
going to generate ${mygentest4jar}
</echo>
<mkdir dir="example/inra_dev_test/bin"/>
<javac debug="true" debuglevel="${debuglevel}" destdir="example/inra_dev_test/bin" includeantruntime="false"
source="${source}" target="${target}">
<src path="example/inra_dev_test/gen"/>
<classpath refid="xmi.classpath"/>
<classpath refid="gen.classpath"/>
</javac>
<jar destfile="${mygentest4jar}" filesetmanifest="mergewithoutmain">
<fileset dir="example/inra_dev_test/bin"/>
</jar>
</target>
<!-- run the generate_test1.sh -->
<target name="generate_test1">
<exec executable="/bin/bash">
<arg value="${dir.buildfile}/generate_test1.sh"/>
</exec>
</target>
<!-- run the generate_test3.sh -->
<target name="generate_test3">
<exec executable="/bin/bash">
<arg value="${dir.buildfile}/generate_test3.sh"/>
</exec>
</target>
<!-- run the generate_test4.sh -->
<target name="generate_inra_dev_test">
<exec executable="/bin/bash">
<arg value="${dir.buildfile}/generate_inra_dev_test.sh"/>
</exec>
</target>
<!-- run the generate_test1.sh and reate_gen_test1_jar -->
<target depends="generate_test1,create_gen_test1_jar" name="all"/>
<target depends="generate_test3,create_gen_test3_jar" name="all3"/>
<target depends="generate_inra_dev_test,create_gen_inra_dev_test_jar" name="all4"/>
</project>