1
|
<!--
|
2
|
|
3
|
Edit_CDM ANT build script.
|
4
|
|
5
|
-->
|
6
|
|
7
|
<project name="cmd" default="compile" basedir=".">
|
8
|
|
9
|
<!-- ################################################################## -->
|
10
|
<!-- ################## Property definitions ########################## -->
|
11
|
<!-- ################################################################## -->
|
12
|
|
13
|
<!-- Name of project and version, used to create filenames -->
|
14
|
<property name="name" value="Taxonomic Common Data Model"/>
|
15
|
<property name="name2" value="cdmLibrary"/>
|
16
|
<property name="version.major" value="1"/>
|
17
|
<property name="version.minor" value="0"/>
|
18
|
<property name="version.micro" value="0"/>
|
19
|
<property name="version.full" value="${version.major}.${version.minor}.${version.micro}"/>
|
20
|
<property name="version.major_minor" value="${version.major}.${version.minor}"/>
|
21
|
<property name="fullname" value="${name}-${version.full}"/>
|
22
|
|
23
|
<!-- Various SCM-controlled directories -->
|
24
|
<property name="dir.src" value="src/main/java" />
|
25
|
<property name="dir.test" value="src/test/java" />
|
26
|
<property name="dir.etc" value="etc" />
|
27
|
<property name="dir.lib" value="lib" />
|
28
|
<property name="dir.doc" value="doc"/>
|
29
|
<property name="dir.doc.api" value="${dir.doc}/api"/>
|
30
|
<property name="dir.doc.ref" value="${dir.doc}/reference"/>
|
31
|
<property name="dir.build" value="target/classes"/>
|
32
|
<property name="dir.build.test" value="target/test-classes"/>
|
33
|
<property name="dir.resources" value="src/main/resources"/>
|
34
|
<property name="dir.test.resources" value="src/test/resources"/>
|
35
|
<property name="dir.maven.local" value="/Users/markus/.m2/repository"/>
|
36
|
|
37
|
<!-- Distribution -->
|
38
|
<property name="dist.dir" value="dist" />
|
39
|
<property name="dist.zip" value="${dist.dir}/zip" />
|
40
|
<property name="dist.jar" value="${dist.dir}/jar" />
|
41
|
<property name="jar.name" value="${name2}"/>
|
42
|
|
43
|
<!-- Configs -->
|
44
|
<property name="spring.cfg" value="${dir.resources}/editCdm.spring.cfg.xml"/>
|
45
|
<property name="log4j.prop" value="${dir.resources}/log4j.properties"/>
|
46
|
|
47
|
|
48
|
<!-- Classpath declaration -->
|
49
|
<path id="project.classpath">
|
50
|
<fileset dir="${dir.maven.local}">
|
51
|
<include name="**/*.jar"/>
|
52
|
<include name="**/**/*.jar"/>
|
53
|
<include name="**/**/**/*.jar"/>
|
54
|
</fileset>
|
55
|
<!--
|
56
|
<fileset dir="${dir.build}">
|
57
|
<include name="**/*.jar"/>
|
58
|
<include name="**/*.zip"/>
|
59
|
</fileset>
|
60
|
<fileset dir="${dir.build.test}">
|
61
|
<include name="**/*.jar"/>
|
62
|
<include name="**/*.zip"/>
|
63
|
</fileset>
|
64
|
-->
|
65
|
</path>
|
66
|
|
67
|
|
68
|
<!-- Useful shortcuts -->
|
69
|
<patternset id="meta.files">
|
70
|
<exclude name="**/org/bgbm/berlinmodel/hibernate/*.xml"/> <!-- by Andreas can be deleted-->
|
71
|
<include name="**/*.xml"/>
|
72
|
<include name="**/*.properties"/>
|
73
|
</patternset>
|
74
|
|
75
|
<!-- xxxxxxxxxxxx TARGETS xxxxxxxxxxxxxxxxxxxxxxxxxxx -->
|
76
|
|
77
|
<!-- Clean up -->
|
78
|
<target name="clean" description="Clean the build directory">
|
79
|
<delete dir="${dir.build}"/>
|
80
|
<mkdir dir="${dir.build}"/>
|
81
|
</target>
|
82
|
|
83
|
|
84
|
<!-- Compile Java source -->
|
85
|
<target name="compile" depends="copyConfigFiles"
|
86
|
description="compile all classes">
|
87
|
<mkdir dir="${dir.build}"/>
|
88
|
<mkdir dir="${dir.build.test}"/>
|
89
|
<javac debug="true" srcdir="${dir.src}"
|
90
|
destdir="${dir.build}"
|
91
|
classpathref="project.classpath"/>
|
92
|
<javac debug="true" srcdir="${dir.test}"
|
93
|
destdir="${dir.build.test}"
|
94
|
classpathref="project.classpath"/>
|
95
|
</target>
|
96
|
|
97
|
<!-- Compile Java test source -->
|
98
|
<target name="compileTest" depends="copyConfigFilesTest"
|
99
|
description="compile all test classes">
|
100
|
<mkdir dir="${dir.build.test}"/>
|
101
|
<javac debug="true" srcdir="${dir.test}"
|
102
|
destdir="${dir.build.test}"
|
103
|
classpathref="project.classpath"/>
|
104
|
</target>
|
105
|
|
106
|
|
107
|
|
108
|
<!-- Copy metadata to build classpath -->
|
109
|
<target name="copyMetaFiles">
|
110
|
<mkdir dir="${dir.build}"/>
|
111
|
<copy todir="${dir.build}">
|
112
|
<fileset dir="${dir.src}">
|
113
|
<patternset refid="meta.files"/>
|
114
|
</fileset>
|
115
|
</copy>
|
116
|
</target>
|
117
|
|
118
|
<!-- Copy configuration files to build classpath -->
|
119
|
<target name="copyConfigFiles">
|
120
|
<mkdir dir="${dir.build}"/>
|
121
|
<copy file="${log4j.prop}" todir="${dir.build}"/>
|
122
|
<copy file="${spring.cfg}" todir="${dir.build}"/>
|
123
|
</target>
|
124
|
|
125
|
|
126
|
<!-- Copy test configuration files to build classpath -->
|
127
|
<target name="copyConfigFilesTest">
|
128
|
<mkdir dir="${dir.build.test}"/>
|
129
|
<copy file="${log4j.prop}" todir="${dir.build}"/>
|
130
|
<copy file="${spring.cfg}" todir="${dir.build}"/>
|
131
|
</target>
|
132
|
|
133
|
<!-- Distribute as ZIP-File -->
|
134
|
<target name="distAsZip" depends="compile"
|
135
|
description="Builds an zip file containing jar and lib-directory. classpathes must be set in manifest.txt
|
136
|
jar is executable">
|
137
|
<delete file="${dist.jar}/${jar.name}.jar"/>
|
138
|
<delete file="${dist.zip}/${jar.name}.zip"/>
|
139
|
<mkdir dir="${dist.jar}" />
|
140
|
<mkdir dir="${dist.zip}" />
|
141
|
<jar jarfile="${dist.jar}/${jar.name}.jar"
|
142
|
basedir="${dir.build}"
|
143
|
manifest="zipManifest.txt" />
|
144
|
<zip destfile="${dist.zip}/${jar.name}.zip">
|
145
|
<fileset dir="." includes="${dir.lib}/*" />
|
146
|
<fileset dir="." includes="${jar.name}.jar" />
|
147
|
</zip>
|
148
|
</target>
|
149
|
|
150
|
</project>
|