HSAdmin Backend Domains, E-Mail, Datenbanken
Peter Hormanns
2011-05-17 1fc5a889d8a6eee3b85a7ea8ec4ee2824836175a
commit | author | age
19ea38 1 <?xml version="1.0" encoding="UTF-8"?>
PH 2 <project name="hsarweb" default="war">
3
4     <property name="build.home" value="${basedir}/build" />
5     <property name="lib.home" value="${basedir}/lib" />
6     <property name="conf.home" value="${basedir}/conf" />
7     <property name="src.home" value="${basedir}/src" />
52ca9d 8     <property name="test.home" value="${basedir}/test" />
19ea38 9     <property name="dist.home" value="${basedir}/dist" />
PH 10
f9c969 11     <property file="${user.home}/.hsar.ant.properties" />
PH 12     
19ea38 13     <!-- Optionen  für Java-Compiler-->
PH 14     <property name="compile.debug" value="true" />
15     <property name="compile.deprecation" value="true" />
16     <property name="compile.optimize" value="true" />
17
18     <path id="compile.classpath">
19         <fileset dir="lib">
20             <include name="*.jar" />
21         </fileset>
22     </path>
23
24     <path id="enhance.classpath">
25         <fileset dir="lib">
26             <include name="*.jar" />
27         </fileset>
28         <dirset dir="conf"/>
29         <dirset dir="${build.home}"/>
30     </path>
31
32     <target name="clean" description="aufräumen">
33         <delete dir="${build.home}" />
34         <delete dir="${dist.home}" />
35     </target>
36
a63757 37     <target name="deploy" depends="war">
66f795 38         <delete dir="${hsar.deploy.dir}/hsar" />
a63757 39         <copy file="build/hsar.war" todir="${hsar.deploy.dir}" />
d704f7 40         <sleep minutes="2"/>
a63757 41     </target>
PH 42
19ea38 43     <target name="war" depends="enhance">
05f77c 44         <copy file="conf/WEB-INF/web.xml" todir="webapp/WEB-INF/">
PH 45             <filterset>
46                 <filter token="LOGIN_HOST" value="${cas.domain.name}"/>
47                 <filter token="LOGIN_PORT" value="${cas.https.port}"/>
48                 <filter token="CONFIG_HOST" value="${hsar.domain.name}"/>
49                 <filter token="CONFIG_PORT" value="${hsar.https.port}"/>
50             </filterset>
51         </copy>
19ea38 52         <war destfile="build/hsar.war" basedir="webapp">
PH 53             <lib dir="lib">
54                 <include name="**/*.jar"/>
55                 <exclude name="**/servlet*.jar"/>
56                 <exclude name="**/geronimo-jms*.jar"/>
1fc5a8 57                 <exclude name="**/geronimo-j2ee-management*.jar"/>
PH 58                 <exclude name="**/activemq*.jar"/>
19ea38 59             </lib>
PH 60             <classes dir="build/cls" />
61             <classes dir="src">
62                 <include name="**/*.properties"/>
726244 63                 <include name="**/*.jtpl"/>
19ea38 64             </classes>
PH 65             <classes dir="conf">
66                 <include name="**/*.xml"/>
67             </classes>
68         </war>
69     </target>
70
71     <target name="compile" description="compilieren">
72         <mkdir dir="${build.home}" />
73         <mkdir dir="${build.home}/cls" />
6d4a3f 74         <javac srcdir="${src.home}" destdir="${build.home}/cls" debug="${compile.debug}" deprecation="${compile.deprecation}" optimize="${compile.optimize}" encoding="UTF8" includeantruntime="false">
19ea38 75             <classpath refid="compile.classpath" />
PH 76         </javac>
77     </target>
78
52ca9d 79     <target name="compile-test" description="tests compilieren" depends="compile">
PH 80         <mkdir dir="${build.home}" />
81         <mkdir dir="${build.home}/test" />
52f677 82         <javac srcdir="${test.home}" destdir="${build.home}/test" debug="${compile.debug}" deprecation="${compile.deprecation}" optimize="${compile.optimize}" encoding="UTF8" includeantruntime="false">
52ca9d 83             <classpath refid="compile.classpath" />
PH 84             <classpath>
85                 <pathelement path="${compile.classpath}"/>
86                 <pathelement location="${build.home}/cls"/>
87                 <pathelement path="/usr/share/java/junit4.jar"/>
88             </classpath>
89         </javac>
90     </target>
91
19ea38 92     <target name="enhance" description="openjpa enhancer" depends="compile">
PH 93         <taskdef name="openjpac" classname="org.apache.openjpa.ant.PCEnhancerTask">
94             <classpath refid="enhance.classpath"/>
95         </taskdef>
96         <taskdef name="mappingtool" classname="org.apache.openjpa.jdbc.ant.MappingToolTask">
97             <classpath refid="enhance.classpath"/>
98         </taskdef>
99         <openjpac>
100             <classpath refid="enhance.classpath"/>
101         </openjpac>
102         <echo message="Enhancing complete."/>
103     </target>
104
f94bfc 105     <target name="init-db" description="init empty database">
PH 106         <sql
a63757 107             classpath="/usr/share/java/postgresql-jdbc3.jar"
f94bfc 108             driver="org.postgresql.Driver" 
f9c969 109             url="jdbc:postgresql://localhost:5432/${database.name}"
PH 110             userid="${database.user}" password="${database.password}" 
f94bfc 111             src="database/schema.sql" />        
PH 112         <sql
a63757 113             classpath="/usr/share/java/postgresql-jdbc3.jar"
f94bfc 114             driver="org.postgresql.Driver" 
f9c969 115             url="jdbc:postgresql://localhost:5432/${database.name}"
PH 116             userid="${database.user}" password="${database.password}" 
f94bfc 117             src="database/data.sql" />        
PH 118     </target>
119     
f9c969 120     <target name="drop-db" description="make empty database">
PH 121         <sql
a63757 122             classpath="/usr/share/java/postgresql-jdbc3.jar"
f9c969 123             driver="org.postgresql.Driver" 
PH 124             url="jdbc:postgresql://localhost:5432/${database.name}"
125             userid="${database.user}" password="${database.password}" 
126             src="database/dropschema.sql" />        
127     </target>
128     
52ca9d 129     <target name="remote-test" description="inspection of xmlrpc-api" depends="compile-test">
2d2947 130         <mkdir dir="${build.home}/junit" />
52ca9d 131         <junit printsummary="yes" fork="yes">
8e990c 132             <jvmarg value="-Djavax.net.ssl.trustStore=${javax.net.ssl.trustStore}"/>
PH 133             <jvmarg value="-Djavax.net.ssl.trustStorePassword=${javax.net.ssl.trustStorePassword}"/>
52ca9d 134             <classpath>
PH 135                 <fileset dir="lib">
136                     <include name="*.jar" />
137                 </fileset>
138                 <pathelement location="${build.home}/cls"/>
139                 <pathelement location="${build.home}/test"/>
140                 <pathelement path="/usr/share/java/junit4.jar"/>
141             </classpath>
142             <formatter type="xml"/>
2d2947 143             <test name="de.hsadmin.remote.RemoteTest" todir="${build.home}/junit" />
52ca9d 144         </junit>
PH 145     </target>
146     
19ea38 147 </project>