-
Notifications
You must be signed in to change notification settings - Fork 5
/
build_jpa.xml
95 lines (76 loc) · 3.26 KB
/
build_jpa.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
<!-- this ant script allows you to run the molgenis generator from the commandline-->
<project default="test">
<property name="project.properties" value="molgenis.test.jpa.properties" />
<property file="${project.properties}"/>
<property name="molgenis.dir" value="../molgenis" />
<property name="build.dir" value="build/classes" />
<property name="testng.report.dir" value="test-output" />
<path id="molgenis.classpath">
<pathelement location="${build.dir}" />
<fileset dir="../molgenis/lib">
<include name="**/*.jar" />
</fileset>
<fileset dir="WebContent/WEB-INF/lib">
<include name="**/*.jar" />
</fileset>
</path>
<taskdef resource="testngtasks" classpathref="molgenis.classpath" />
<target name="clean">
<!-- remove and create generated folder -->
<delete includeEmptyDirs="true" failonerror="false">
<fileset dir="${output_src}" />
<fileset dir="${build.dir}" />
<fileset dir="${testng.report.dir}" />
</delete>
<mkdir dir="${build.dir}" />
<mkdir dir="${output_src}" />
<mkdir dir="${testng.report.dir}" />
</target>
<target name="generate" depends="clean">
<!-- check if the molgenis project is where it is to be expected, in ../molgenis/ -->
<condition property="dir.exists">
<available file="${molgenis.dir}" type="dir" />
</condition>
<!-- check if molgenis is compiled into ../molgenis/bin, otherwise compile now -->
<javac srcdir="${molgenis.dir}/src" destdir="${build.dir}" nowarn="on" debug="true">
<classpath refid="molgenis.classpath" />
</javac>
<copy todir="${build.dir}">
<fileset dir="${molgenis.dir}/src" includes="**/*.xml,**/*.properties,**/*.txt,**/*.ico,**/*.js,**/*.css,**/*.jpg,**/*.png,**/*.gif,**/*.ftl" />
</copy>
<!-- call the generator -->
<java classname="org.molgenis.Molgenis" fork="yes" failonerror="true">
<classpath refid="molgenis.classpath" />
<arg value="${project.properties}" />
</java>
</target>
<target name="compile" depends="generate">
<!-- compile the generated results -->
<javac srcdir="${output_src}:${output_hand}" destdir="${build.dir}" nowarn="on" debug="true">
<classpath refid="molgenis.classpath" />
</javac>
<!-- copy resources like properties files -->
<copy todir="${build.dir}">
<fileset dir="${output_src}" includes="**/*.xml,**/*.properties,**/*.txt,**/*.ico" />
<fileset dir="${output_hand}" includes="**/*.xml,**/*.properties,**/*.txt,**/*.ico" />
<fileset dir="${output_sql}" includes="**/*.xml,**/*.properties,**/*.txt,**/*.ico" />
</copy>
</target>
<target name="test" depends="compile">
<!-- run the tests -->
<testng classpathref="molgenis.classpath" outputDir="${testng.report.dir}" haltOnFailure="true">
<xmlfileset dir="${build.dir}" includes="testng1.xml" />
<jvmarg value="-ea" />
</testng>
<testng classpathref="molgenis.classpath" outputDir="${testng.report.dir}" haltOnFailure="true">
<xmlfileset dir="${build.dir}" includes="testng2.xml" />
<jvmarg value="-ea" />
</testng>
<!--junitreport todir="${testng.report.dir}">
<fileset dir="${testng.report.dir}">
<include name="*/*.xml" />
</fileset>
<report format="noframes" todir="${testng.report.dir}" />
</junitreport-->
</target>
</project>