HSAdmin Backend Domains, E-Mail, Datenbanken
Peter Hormanns
2011-05-05 66f795f1f31a16eb1861a402a554d457889a5897
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" />
8     <property name="dist.home" value="${basedir}/dist" />
9
f9c969 10     <property file="${user.home}/.hsar.ant.properties" />
PH 11     
19ea38 12     <!-- Optionen  für Java-Compiler-->
PH 13     <property name="compile.debug" value="true" />
14     <property name="compile.deprecation" value="true" />
15     <property name="compile.optimize" value="true" />
16
17     <path id="compile.classpath">
18         <fileset dir="lib">
19             <include name="*.jar" />
20         </fileset>
21     </path>
22
23     <path id="enhance.classpath">
24         <fileset dir="lib">
25             <include name="*.jar" />
26         </fileset>
27         <dirset dir="conf"/>
28         <dirset dir="${build.home}"/>
29     </path>
30
31     <target name="clean" description="aufräumen">
32         <delete dir="${build.home}" />
33         <delete dir="${dist.home}" />
34     </target>
35
a63757 36     <target name="deploy" depends="war">
66f795 37         <delete dir="${hsar.deploy.dir}/hsar" />
a63757 38         <copy file="build/hsar.war" todir="${hsar.deploy.dir}" />
PH 39     </target>
40
19ea38 41     <target name="war" depends="enhance">
05f77c 42         <copy file="conf/WEB-INF/web.xml" todir="webapp/WEB-INF/">
PH 43             <filterset>
44                 <filter token="LOGIN_HOST" value="${cas.domain.name}"/>
45                 <filter token="LOGIN_PORT" value="${cas.https.port}"/>
46                 <filter token="CONFIG_HOST" value="${hsar.domain.name}"/>
47                 <filter token="CONFIG_PORT" value="${hsar.https.port}"/>
48             </filterset>
49         </copy>
19ea38 50         <war destfile="build/hsar.war" basedir="webapp">
PH 51             <lib dir="lib">
52                 <include name="**/*.jar"/>
53                 <exclude name="**/servlet*.jar"/>
54                 <exclude name="**/geronimo-jms*.jar"/>
55             </lib>
56             <classes dir="build/cls" />
57             <classes dir="src">
58                 <include name="**/*.properties"/>
726244 59                 <include name="**/*.jtpl"/>
19ea38 60             </classes>
PH 61             <classes dir="conf">
62                 <include name="**/*.xml"/>
63             </classes>
64         </war>
65     </target>
66
67     <target name="compile" description="compilieren">
68         <mkdir dir="${build.home}" />
69         <mkdir dir="${build.home}/cls" />
0fbca0 70         <javac srcdir="${src.home}" destdir="${build.home}/cls" debug="${compile.debug}" deprecation="${compile.deprecation}" optimize="${compile.optimize}" encoding="UTF8">
19ea38 71             <classpath refid="compile.classpath" />
PH 72         </javac>
73     </target>
74
75     <target name="enhance" description="openjpa enhancer" depends="compile">
76         <taskdef name="openjpac" classname="org.apache.openjpa.ant.PCEnhancerTask">
77             <classpath refid="enhance.classpath"/>
78         </taskdef>
79         <taskdef name="mappingtool" classname="org.apache.openjpa.jdbc.ant.MappingToolTask">
80             <classpath refid="enhance.classpath"/>
81         </taskdef>
82         <openjpac>
83             <classpath refid="enhance.classpath"/>
84         </openjpac>
85         <echo message="Enhancing complete."/>
86     </target>
87
f94bfc 88     <target name="init-db" description="init empty database">
PH 89         <sql
a63757 90             classpath="/usr/share/java/postgresql-jdbc3.jar"
f94bfc 91             driver="org.postgresql.Driver" 
f9c969 92             url="jdbc:postgresql://localhost:5432/${database.name}"
PH 93             userid="${database.user}" password="${database.password}" 
f94bfc 94             src="database/schema.sql" />        
PH 95         <sql
a63757 96             classpath="/usr/share/java/postgresql-jdbc3.jar"
f94bfc 97             driver="org.postgresql.Driver" 
f9c969 98             url="jdbc:postgresql://localhost:5432/${database.name}"
PH 99             userid="${database.user}" password="${database.password}" 
f94bfc 100             src="database/data.sql" />        
PH 101     </target>
102     
f9c969 103     <target name="drop-db" description="make empty database">
PH 104         <sql
a63757 105             classpath="/usr/share/java/postgresql-jdbc3.jar"
f9c969 106             driver="org.postgresql.Driver" 
PH 107             url="jdbc:postgresql://localhost:5432/${database.name}"
108             userid="${database.user}" password="${database.password}" 
109             src="database/dropschema.sql" />        
110     </target>
111     
19ea38 112 </project>