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