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