This repository has been archived by the owner on Aug 23, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
/
build_old.xml
127 lines (107 loc) · 4.26 KB
/
build_old.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
<!-- this ant script allows you to run the molgenis generator from the commandline-->
<project default="test">
<property file="molgenis.test.properties" />
<property name="molgenis.dir" value="../molgenis" />
<property name="build.dir" value="build/classes" />
<property name="testng.report.dir" value="test-output" />
<property name="war.dir" value="war" />
<property name="war.name" value="gcc.war" />
<property name="webxml.dir" value="WebContent/WEB-INF/web.xml" />
<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}" />
<fileset dir="${war.dir}" />
</delete>
<mkdir dir="${build.dir}" />
<mkdir dir="${output_src}" />
<mkdir dir="${testng.report.dir}" />
<mkdir dir="${war.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">
<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="molgenis.test.properties" />
<!--arg value="handwritten/apps/org/molgenis/gcc/gcc.properties" /-->
</java>
</target>
<target name="compile" depends="generate">
<!-- compile the generated results, use fork to run it with its own memory settings -->
<javac fork="true" srcdir="${output_src}:${output_hand}:handwritten/webserver" destdir="${build.dir}" nowarn="on" memoryinitialsize="256m"
memorymaximumsize="512m">
<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="testng.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>
<target name="javadoc">
<javadoc access="public" destdir="${dir.javadoc}" author="true"
version="true" noindex="false" use="true" classpathref="classpath">
<fileset dir="handwritten/java" defaultexcludes="yes">
<include name="**/*.java" />
<exclude name="org/test/**/*.java" />
</fileset>
<fileset dir="generated/java" defaultexcludes="yes">
<include name="**/*.java" />
<exclude name="org/test/**/*.java" />
</fileset>
</javadoc>
</target>
<target name="makeWar" depends="compile">
<!-- the ant war task. with all resources in place, create the war file -->
<war destfile="${war.dir}/${war.name}" webxml="${webxml.dir}">
<classes dir="${build.dir}">
<include name="**/*"/>
</classes>
<lib dir="../molgenis/lib">
<include name="**/*.jar" />
</lib>
<lib dir="WebContent/WEB-INF/lib">
<include name="**/*.jar" />
</lib>
<metainf dir="WebContent/META-INF">
</metainf>
</war>
</target>
</project>