more verbose reports and demo VamsasDocument testing
[vamsas.git] / build.xml
1 <?xml version="1.0"?>
2 <project name="vamsas-client" default="build" basedir=".">
3
4         <target name="init">
5                 <property name="libDir" value="lib"/>
6                 <property name="toolsDir" value="tools"/>
7                 <property name="resourceDir" value="resources"/>
8                 <property name="sourceDir" value="src" />
9                 <property name="outputDir" value="classes" />
10                 <property name="packageDir" value="packages" />
11                 <property name="vamsas.schema" value="schemas/vamsas.xsd" />
12                 <property name="vamsas.doc.schema" value="schemas/vamsasDocument.xsd" />
13                 <property name="vamsas.schema.package" value="org.vamsas.objects.core" />
14                 <property name="vamsas.schema.package.src" value="org/vamsas/objects/core" />
15                 <property name="vamsas.schema.sourcegen.properties" value="schemas/castorbuilder.properties"/>
16                 <path id="castor.classpath">
17                         <fileset dir="tools">
18                                 <include name="*.jar"/>
19                                 <include name="**/*.jar"/>
20                         </fileset>
21                         <fileset dir="lib">
22                                 <include name="*.jar"/>
23                                 <include name="**/*.jar"/>
24                         </fileset>
25                 </path>
26                         
27                 <!--
28                 Build classpath
29                 -->
30                 <path id="build.classpath">
31                         <fileset dir="${toolsDir}">
32                                 <include name="*.jar"/>
33                                 <include name="**/*.jar"/>
34                         </fileset>
35
36                         <fileset dir="${libDir}">
37                                 <include name="*.jar"/>
38                                 <include name="**/*.jar"/>
39                         </fileset>
40                         <!--            path refid="axis.classpath"  -->
41                 </path>
42         </target>
43         <target name="cleancoresource" depends="init" description="Clean automatically generated packages">
44                 <delete>
45                         <fileset dir="${sourceDir}/${vamsas.schema.package.src}">
46                                 <include name="*.java"/>
47                         </fileset>
48                 </delete>
49         </target>
50         <target name="makecoresource" depends="init, cleancoresource" description="Generate Java source files from XSD.">
51         <taskdef name="castor-srcgen"
52                   classname="org.exolab.castor.tools.ant.taskdefs.CastorSourceGenTask"
53               classpathref="castor.classpath" />
54         <!-- Should apply this to every schema file in ${vamsas.schemas} directory -->
55                 <castor-srcgen file="${vamsas.schema}"
56               todir="${sourceDir}"
57               package="${vamsas.schema.package}"
58               warnings="false" 
59                   nodesc="false"
60                 properties="${vamsas.schema.sourcegen.properties}"
61         />      
62                 <castor-srcgen file="${vamsas.doc.schema}"
63                               todir="${sourceDir}"
64                               package="${vamsas.schema.package}"
65                               warnings="false" 
66                                   nodesc="false"
67                                 properties="${vamsas.schema.sourcegen.properties}"
68                         />      
69         </target>
70         <target name="prepare" depends="init">
71                 <mkdir dir="${packageDir}"/>
72                 <mkdir dir="${outputDir}"/>
73                 <copy todir="${outputDir}">
74                         <fileset dir="${resourceDir}" />
75                 </copy>
76         </target>
77         <target name="clean" depends="init">
78                 <delete>
79                         <fileset dir="${outputDir}">
80                                 <include name="*"/>
81                                 <include name="*.*"/>
82                                 <include name="**/*"/>
83                                 <include name="**/*.*"/>
84                         </fileset>
85                 </delete>
86                 <delete dir="${axisbuild}"/>
87                 <!--    <ant dir="test" antfile="build.xml" target="clean"
88 inheritRefs="true"/> -->
89         </target>
90         <target name="realclean" depends="init, clean">
91                 <delete dir="${packageDir}"/>
92         </target>
93         <target name="distclean" depends="init, realclean">
94                 <echo message="REMOVING ALL BACKUP/AUTOSAVES!"/>
95                 <delete>
96                         <fileset dir=".">
97                                 <include name="#*#"/>
98                                 <include name="#*.*#"/>
99                                 <include name="**/#*#"/>
100                                 <include name="**/#*.*#"/>
101                                 <include name="*~"/>
102                                 <include name="*.*~"/>
103                                 <include name="**/*~"/>
104                                 <include name="**/*.*~"/>
105                         </fileset>
106                 </delete>
107         </target>
108
109         <target name="build" depends="init, prepare">
110                 <!-- not efficient yet. : use excludes="*/localtest/*.java" if local tests are not building -->
111                 <javac classpathref="build.classpath" debug="on" srcdir="${sourceDir}" destdir="${outputDir}" />
112         </target>
113
114 </project>
115
116