HSAdmin Backend Domains, E-Mail, Datenbanken
Peter Hormanns
2019-06-18 97bfe29c61481015c6ae5b68a12fd3b662335abb
commit | author | age
19ea38 1 <?xml version="1.0" encoding="UTF-8"?>
e30c0b 2 <project name="hsarback" default="war">
19ea38 3
PH 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"/>
6208e0 50                 <include name="**/*.vm"/>
873c2a 51             </fileset>
PH 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"/>
6208e0 80                 <include name="**/*.vm"/>
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" />
6a0297 91         <javac srcdir="${src.home}" destdir="${build.home}/cls" 
2fed8a 92                 source="1.6" target="1.6"
6a0297 93                 debug="${compile.debug}" deprecation="${compile.deprecation}" 
PH 94                 optimize="${compile.optimize}" encoding="UTF8" includeantruntime="false">
19ea38 95             <classpath refid="compile.classpath" />
PH 96         </javac>
97     </target>
98
52ca9d 99     <target name="compile-test" description="tests compilieren" depends="compile">
PH 100         <mkdir dir="${build.home}" />
101         <mkdir dir="${build.home}/test" />
6a0297 102         <javac 
PH 103                 srcdir="${test.home}" destdir="${build.home}/test"
2fed8a 104                 source="1.6" target="1.6"
6a0297 105                 debug="${compile.debug}" deprecation="${compile.deprecation}" 
PH 106                 optimize="${compile.optimize}" encoding="UTF8" includeantruntime="false">
52ca9d 107             <classpath refid="compile.classpath" />
PH 108             <classpath>
109                 <pathelement path="${compile.classpath}"/>
110                 <pathelement location="${build.home}/cls"/>
111                 <pathelement path="/usr/share/java/junit4.jar"/>
112             </classpath>
113         </javac>
114     </target>
115
19ea38 116     <target name="enhance" description="openjpa enhancer" depends="compile">
PH 117         <taskdef name="openjpac" classname="org.apache.openjpa.ant.PCEnhancerTask">
118             <classpath refid="enhance.classpath"/>
119         </taskdef>
120         <taskdef name="mappingtool" classname="org.apache.openjpa.jdbc.ant.MappingToolTask">
121             <classpath refid="enhance.classpath"/>
122         </taskdef>
123         <openjpac>
124             <classpath refid="enhance.classpath"/>
125         </openjpac>
126         <echo message="Enhancing complete."/>
127     </target>
128
f94bfc 129     <target name="init-db" description="init empty database">
PH 130         <sql
a63757 131             classpath="/usr/share/java/postgresql-jdbc3.jar"
f94bfc 132             driver="org.postgresql.Driver" 
e0f257 133             url="jdbc:postgresql://${database.host}:5432/${database.name}"
f9c969 134             userid="${database.user}" password="${database.password}" 
f94bfc 135             src="database/schema.sql" />        
PH 136         <sql
a63757 137             classpath="/usr/share/java/postgresql-jdbc3.jar"
f94bfc 138             driver="org.postgresql.Driver" 
e0f257 139             url="jdbc:postgresql://${database.host}:5432/${database.name}"
f9c969 140             userid="${database.user}" password="${database.password}" 
f94bfc 141             src="database/data.sql" />        
PH 142     </target>
143     
f9c969 144     <target name="drop-db" description="make empty database">
PH 145         <sql
a63757 146             classpath="/usr/share/java/postgresql-jdbc3.jar"
f9c969 147             driver="org.postgresql.Driver" 
e0f257 148             url="jdbc:postgresql://${database.host}:5432/${database.name}"
f9c969 149             userid="${database.user}" password="${database.password}" 
bf92f5 150             src="database/dropschema.sql" />
f9c969 151     </target>
PH 152     
0b888d 153     <target name="update-db" description="upgrade existing database">
PH 154         <sql
155             classpath="/usr/share/java/postgresql-jdbc3.jar"
156             driver="org.postgresql.Driver" 
157             url="jdbc:postgresql://${database.host}:5432/${database.name}"
158             userid="${database.user}" password="${database.password}" 
159             src="database/database_update.sql" />
160     </target>
161     
52ca9d 162     <target name="remote-test" description="inspection of xmlrpc-api" depends="compile-test">
2d2947 163         <mkdir dir="${build.home}/junit" />
52ca9d 164         <junit printsummary="yes" fork="yes">
PH 165             <classpath>
166                 <fileset dir="lib">
167                     <include name="*.jar" />
168                 </fileset>
169                 <pathelement location="${build.home}/cls"/>
170                 <pathelement location="${build.home}/test"/>
171                 <pathelement path="/usr/share/java/junit4.jar"/>
172             </classpath>
173             <formatter type="xml"/>
984777 174             <test name="de.hsadmin.remote.ContinuousIntegrationTest" todir="${build.home}/junit" />
52ca9d 175         </junit>
PH 176     </target>
177     
19ea38 178 </project>