HSAdmin Backend Domains, E-Mail, Datenbanken
Peter Hormanns
2011-05-06 6d4a3fbca9d42f7ac0edc83b5cba012c001fe8f8
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}" />
PH 40     </target>
41
19ea38 42     <target name="war" depends="enhance">
05f77c 43         <copy file="conf/WEB-INF/web.xml" todir="webapp/WEB-INF/">
PH 44             <filterset>
45                 <filter token="LOGIN_HOST" value="${cas.domain.name}"/>
46                 <filter token="LOGIN_PORT" value="${cas.https.port}"/>
47                 <filter token="CONFIG_HOST" value="${hsar.domain.name}"/>
48                 <filter token="CONFIG_PORT" value="${hsar.https.port}"/>
49             </filterset>
50         </copy>
19ea38 51         <war destfile="build/hsar.war" basedir="webapp">
PH 52             <lib dir="lib">
53                 <include name="**/*.jar"/>
54                 <exclude name="**/servlet*.jar"/>
55                 <exclude name="**/geronimo-jms*.jar"/>
56             </lib>
57             <classes dir="build/cls" />
58             <classes dir="src">
59                 <include name="**/*.properties"/>
726244 60                 <include name="**/*.jtpl"/>
19ea38 61             </classes>
PH 62             <classes dir="conf">
63                 <include name="**/*.xml"/>
64             </classes>
65         </war>
66     </target>
67
68     <target name="compile" description="compilieren">
69         <mkdir dir="${build.home}" />
70         <mkdir dir="${build.home}/cls" />
6d4a3f 71         <javac srcdir="${src.home}" destdir="${build.home}/cls" debug="${compile.debug}" deprecation="${compile.deprecation}" optimize="${compile.optimize}" encoding="UTF8" includeantruntime="false">
19ea38 72             <classpath refid="compile.classpath" />
PH 73         </javac>
74     </target>
75
52ca9d 76     <target name="compile-test" description="tests compilieren" depends="compile">
PH 77         <mkdir dir="${build.home}" />
78         <mkdir dir="${build.home}/test" />
79         <javac srcdir="${test.home}" destdir="${build.home}/test" debug="${compile.debug}" deprecation="${compile.deprecation}" optimize="${compile.optimize}" encoding="UTF8">
80             <classpath refid="compile.classpath" />
81             <classpath>
82                 <pathelement path="${compile.classpath}"/>
83                 <pathelement location="${build.home}/cls"/>
84                 <pathelement path="/usr/share/java/junit4.jar"/>
85             </classpath>
86         </javac>
87     </target>
88
19ea38 89     <target name="enhance" description="openjpa enhancer" depends="compile">
PH 90         <taskdef name="openjpac" classname="org.apache.openjpa.ant.PCEnhancerTask">
91             <classpath refid="enhance.classpath"/>
92         </taskdef>
93         <taskdef name="mappingtool" classname="org.apache.openjpa.jdbc.ant.MappingToolTask">
94             <classpath refid="enhance.classpath"/>
95         </taskdef>
96         <openjpac>
97             <classpath refid="enhance.classpath"/>
98         </openjpac>
99         <echo message="Enhancing complete."/>
100     </target>
101
f94bfc 102     <target name="init-db" description="init empty database">
PH 103         <sql
a63757 104             classpath="/usr/share/java/postgresql-jdbc3.jar"
f94bfc 105             driver="org.postgresql.Driver" 
f9c969 106             url="jdbc:postgresql://localhost:5432/${database.name}"
PH 107             userid="${database.user}" password="${database.password}" 
f94bfc 108             src="database/schema.sql" />        
PH 109         <sql
a63757 110             classpath="/usr/share/java/postgresql-jdbc3.jar"
f94bfc 111             driver="org.postgresql.Driver" 
f9c969 112             url="jdbc:postgresql://localhost:5432/${database.name}"
PH 113             userid="${database.user}" password="${database.password}" 
f94bfc 114             src="database/data.sql" />        
PH 115     </target>
116     
f9c969 117     <target name="drop-db" description="make empty database">
PH 118         <sql
a63757 119             classpath="/usr/share/java/postgresql-jdbc3.jar"
f9c969 120             driver="org.postgresql.Driver" 
PH 121             url="jdbc:postgresql://localhost:5432/${database.name}"
122             userid="${database.user}" password="${database.password}" 
123             src="database/dropschema.sql" />        
124     </target>
125     
52ca9d 126     <target name="remote-test" description="inspection of xmlrpc-api" depends="compile-test">
2d2947 127         <mkdir dir="${build.home}/junit" />
52ca9d 128         <junit printsummary="yes" fork="yes">
8e990c 129             <jvmarg value="-Djavax.net.ssl.trustStore=${javax.net.ssl.trustStore}"/>
PH 130             <jvmarg value="-Djavax.net.ssl.trustStorePassword=${javax.net.ssl.trustStorePassword}"/>
52ca9d 131             <classpath>
PH 132                 <fileset dir="lib">
133                     <include name="*.jar" />
134                 </fileset>
135                 <pathelement location="${build.home}/cls"/>
136                 <pathelement location="${build.home}/test"/>
137                 <pathelement path="/usr/share/java/junit4.jar"/>
138             </classpath>
139             <formatter type="xml"/>
2d2947 140             <test name="de.hsadmin.remote.RemoteTest" todir="${build.home}/junit" />
52ca9d 141         </junit>
PH 142     </target>
143     
19ea38 144 </project>