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