3 Edit_CDM ANT build script.
7 <project name=
"cmd" default=
"compile" basedir=
".">
9 <!-- ################################################################## -->
10 <!-- ################## Property definitions ########################## -->
11 <!-- ################################################################## -->
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}"/>
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"/>
37 <property name=
"dist.dir" value=
"dist" />
38 <property name=
"dist.zip" value=
"${dist.dir}/zip" />
39 <property name=
"dist.jar" value=
"${dist.dir}/jar" />
40 <property name=
"jar.name" value=
"${name2}"/>
43 <property name=
"spring.cfg" value=
"${dir.resources}/editCdm.spring.cfg.xml"/>
44 <property name=
"log4j.prop" value=
"${dir.resources}/log4j.properties"/>
47 <!-- Classpath declaration -->
48 <path id=
"project.classpath">
49 <fileset dir=
"${dir.build}">
50 <include name=
"**/*.jar"/>
51 <include name=
"**/*.zip"/>
53 <fileset dir=
"${dir.build.test}">
54 <include name=
"**/*.jar"/>
55 <include name=
"**/*.zip"/>
60 <!-- Useful shortcuts -->
61 <patternset id=
"meta.files">
62 <exclude name=
"**/org/bgbm/berlinmodel/hibernate/*.xml"/> <!-- by Andreas can be deleted-->
63 <include name=
"**/*.xml"/>
64 <include name=
"**/*.properties"/>
67 <!-- xxxxxxxxxxxx TARGETS xxxxxxxxxxxxxxxxxxxxxxxxxxx -->
70 <target name=
"clean" description=
"Clean the build directory">
71 <delete dir=
"${dir.build}"/>
72 <mkdir dir=
"${dir.build}"/>
76 <!-- Compile Java source -->
77 <target name=
"compile" depends=
"copyConfigFiles"
78 description=
"compile all classes">
79 <mkdir dir=
"${dir.build}"/>
80 <mkdir dir=
"${dir.build.test}"/>
81 <javac debug=
"true" srcdir=
"${dir.src}"
82 destdir=
"${dir.build}"
83 classpathref=
"project.classpath"/>
84 <javac debug=
"true" srcdir=
"${dir.test}"
85 destdir=
"${dir.build.test}"
86 classpathref=
"project.classpath"/>
89 <!-- Compile Java test source -->
90 <target name=
"compileTest" depends=
"copyConfigFilesTest"
91 description=
"compile all test classes">
92 <mkdir dir=
"${dir.build.test}"/>
93 <javac debug=
"true" srcdir=
"${dir.test}"
94 destdir=
"${dir.build.test}"
95 classpathref=
"project.classpath"/>
100 <!-- Copy metadata to build classpath -->
101 <target name=
"copyMetaFiles">
102 <mkdir dir=
"${dir.build}"/>
103 <copy todir=
"${dir.build}">
104 <fileset dir=
"${dir.src}">
105 <patternset refid=
"meta.files"/>
110 <!-- Copy configuration files to build classpath -->
111 <target name=
"copyConfigFiles">
112 <mkdir dir=
"${dir.build}"/>
113 <copy file=
"${log4j.prop}" todir=
"${dir.build}"/>
114 <copy file=
"${spring.cfg}" todir=
"${dir.build}"/>
118 <!-- Copy test configuration files to build classpath -->
119 <target name=
"copyConfigFilesTest">
120 <mkdir dir=
"${dir.build.test}"/>
121 <copy file=
"${log4j.prop}" todir=
"${dir.build}"/>
122 <copy file=
"${spring.cfg}" todir=
"${dir.build}"/>
125 <!-- Distribute as ZIP-File -->
126 <target name=
"distAsZip" depends=
"compile"
127 description=
"Builds an zip file containing jar and lib-directory. classpathes must be set in manifest.txt
129 <delete file=
"${dist.jar}/${jar.name}.jar"/>
130 <delete file=
"${dist.zip}/${jar.name}.zip"/>
131 <mkdir dir=
"${dist.jar}" />
132 <mkdir dir=
"${dist.zip}" />
133 <jar jarfile=
"${dist.jar}/${jar.name}.jar"
134 basedir=
"${dir.build}"
135 manifest=
"zipManifest.txt" />
136 <zip destfile=
"${dist.zip}/${jar.name}.zip">
137 <fileset dir=
"." includes=
"${dir.lib}/*" />
138 <fileset dir=
"." includes=
"${jar.name}.jar" />