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