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