hs.hsadmin/hsarback/build.xml

179 lines
6.0 KiB
XML
Raw Permalink Normal View History

2010-10-01 21:42:49 +02:00
<?xml version="1.0" encoding="UTF-8"?>
2013-05-10 13:44:09 +02:00
<project name="hsarback" default="war">
2010-10-01 21:42:49 +02:00
<property name="build.home" value="${basedir}/build" />
<property name="lib.home" value="${basedir}/lib" />
<property name="conf.home" value="${basedir}/conf" />
<property name="src.home" value="${basedir}/src" />
2011-05-06 12:28:11 +02:00
<property name="test.home" value="${basedir}/test" />
2010-10-01 21:42:49 +02:00
<property name="dist.home" value="${basedir}/dist" />
2011-03-25 18:37:16 +01:00
<property file="${user.home}/.hsar.ant.properties" />
2010-10-01 21:42:49 +02:00
<!-- Optionen für Java-Compiler-->
<property name="compile.debug" value="true" />
<property name="compile.deprecation" value="true" />
<property name="compile.optimize" value="true" />
<path id="compile.classpath">
<fileset dir="lib">
<include name="*.jar" />
</fileset>
</path>
<path id="enhance.classpath">
<fileset dir="lib">
<include name="*.jar" />
</fileset>
<dirset dir="conf"/>
<dirset dir="${build.home}"/>
</path>
<target name="clean" description="aufräumen">
<delete dir="${build.home}" />
<delete dir="${dist.home}" />
2011-12-19 16:40:48 +01:00
<delete file="webapp/WEB-INF/web.xml" />
2012-04-05 15:35:31 +02:00
<delete file="webapp/META-INF/context.xml" />
2010-10-01 21:42:49 +02:00
</target>
2011-05-05 16:29:06 +02:00
<target name="deploy" depends="war">
2011-05-05 18:00:25 +02:00
<delete dir="${hsar.deploy.dir}/hsar" />
2011-05-05 16:29:06 +02:00
<copy file="build/hsar.war" todir="${hsar.deploy.dir}" />
2012-09-21 14:16:22 +02:00
<!-- <sleep minutes="2"/> -->
2011-05-05 16:29:06 +02:00
</target>
2011-07-07 15:55:41 +02:00
<target name="jar" depends="enhance">
<jar destfile="build/hsar.jar">
<fileset dir="build/cls"/>
<fileset dir="src">
<include name="**/*.properties"/>
2013-02-20 17:24:23 +01:00
<include name="**/*.vm"/>
2011-07-07 15:55:41 +02:00
</fileset>
<fileset dir="conf">
<include name="**/*.xml"/>
</fileset>
</jar>
</target>
2010-10-01 21:42:49 +02:00
<target name="war" depends="enhance">
2012-04-05 15:35:31 +02:00
<copy file="conf/WEB-INF/${target}-web.xml" tofile="webapp/WEB-INF/web.xml">
2011-05-05 17:43:26 +02:00
<filterset>
<filter token="LOGIN_HOST" value="${cas.domain.name}"/>
<filter token="LOGIN_PORT" value="${cas.https.port}"/>
<filter token="CONFIG_HOST" value="${hsar.domain.name}"/>
<filter token="CONFIG_PORT" value="${hsar.https.port}"/>
</filterset>
</copy>
2012-04-05 15:35:31 +02:00
<copy file="conf/META-INF/${target}-context.xml" tofile="webapp/META-INF/context.xml">
2012-04-05 15:23:24 +02:00
</copy>
2012-04-05 15:35:31 +02:00
<war destfile="build/hsar.war" basedir="webapp" needxmlfile="false">
2010-10-01 21:42:49 +02:00
<lib dir="lib">
<include name="**/*.jar"/>
<exclude name="**/servlet*.jar"/>
<exclude name="**/geronimo-jms*.jar"/>
2011-05-17 19:46:03 +02:00
<exclude name="**/geronimo-j2ee-management*.jar"/>
<exclude name="**/activemq*.jar"/>
2010-10-01 21:42:49 +02:00
</lib>
<classes dir="build/cls" />
<classes dir="src">
<include name="**/*.properties"/>
2013-02-20 17:24:23 +01:00
<include name="**/*.vm"/>
2010-10-01 21:42:49 +02:00
</classes>
<classes dir="conf">
<include name="**/*.xml"/>
</classes>
</war>
</target>
<target name="compile" description="compilieren">
<mkdir dir="${build.home}" />
<mkdir dir="${build.home}/cls" />
2016-04-08 12:33:17 +02:00
<javac srcdir="${src.home}" destdir="${build.home}/cls"
2016-04-08 12:38:03 +02:00
source="1.6" target="1.6"
2016-04-08 12:33:17 +02:00
debug="${compile.debug}" deprecation="${compile.deprecation}"
optimize="${compile.optimize}" encoding="UTF8" includeantruntime="false">
2010-10-01 21:42:49 +02:00
<classpath refid="compile.classpath" />
</javac>
</target>
2011-05-06 12:28:11 +02:00
<target name="compile-test" description="tests compilieren" depends="compile">
<mkdir dir="${build.home}" />
<mkdir dir="${build.home}/test" />
2016-04-08 12:33:17 +02:00
<javac
srcdir="${test.home}" destdir="${build.home}/test"
2016-04-08 12:38:03 +02:00
source="1.6" target="1.6"
2016-04-08 12:33:17 +02:00
debug="${compile.debug}" deprecation="${compile.deprecation}"
optimize="${compile.optimize}" encoding="UTF8" includeantruntime="false">
2011-05-06 12:28:11 +02:00
<classpath refid="compile.classpath" />
<classpath>
<pathelement path="${compile.classpath}"/>
<pathelement location="${build.home}/cls"/>
<pathelement path="/usr/share/java/junit4.jar"/>
</classpath>
</javac>
</target>
2010-10-01 21:42:49 +02:00
<target name="enhance" description="openjpa enhancer" depends="compile">
<taskdef name="openjpac" classname="org.apache.openjpa.ant.PCEnhancerTask">
<classpath refid="enhance.classpath"/>
</taskdef>
<taskdef name="mappingtool" classname="org.apache.openjpa.jdbc.ant.MappingToolTask">
<classpath refid="enhance.classpath"/>
</taskdef>
<openjpac>
<classpath refid="enhance.classpath"/>
</openjpac>
<echo message="Enhancing complete."/>
</target>
<target name="init-db" description="init empty database">
<sql
2011-05-05 16:29:06 +02:00
classpath="/usr/share/java/postgresql-jdbc3.jar"
driver="org.postgresql.Driver"
2011-12-19 15:10:37 +01:00
url="jdbc:postgresql://${database.host}:5432/${database.name}"
2011-03-25 18:37:16 +01:00
userid="${database.user}" password="${database.password}"
src="database/schema.sql" />
<sql
2011-05-05 16:29:06 +02:00
classpath="/usr/share/java/postgresql-jdbc3.jar"
driver="org.postgresql.Driver"
2011-12-19 15:10:37 +01:00
url="jdbc:postgresql://${database.host}:5432/${database.name}"
2011-03-25 18:37:16 +01:00
userid="${database.user}" password="${database.password}"
src="database/data.sql" />
</target>
2011-03-25 18:37:16 +01:00
<target name="drop-db" description="make empty database">
<sql
2011-05-05 16:29:06 +02:00
classpath="/usr/share/java/postgresql-jdbc3.jar"
2011-03-25 18:37:16 +01:00
driver="org.postgresql.Driver"
2011-12-19 15:10:37 +01:00
url="jdbc:postgresql://${database.host}:5432/${database.name}"
2011-03-25 18:37:16 +01:00
userid="${database.user}" password="${database.password}"
2011-12-19 16:40:48 +01:00
src="database/dropschema.sql" />
2011-03-25 18:37:16 +01:00
</target>
<target name="update-db" description="upgrade existing database">
<sql
classpath="/usr/share/java/postgresql-jdbc3.jar"
driver="org.postgresql.Driver"
url="jdbc:postgresql://${database.host}:5432/${database.name}"
userid="${database.user}" password="${database.password}"
src="database/database_update.sql" />
</target>
2011-05-06 12:28:11 +02:00
<target name="remote-test" description="inspection of xmlrpc-api" depends="compile-test">
2011-05-06 13:01:58 +02:00
<mkdir dir="${build.home}/junit" />
2011-05-06 12:28:11 +02:00
<junit printsummary="yes" fork="yes">
<classpath>
<fileset dir="lib">
<include name="*.jar" />
</fileset>
<pathelement location="${build.home}/cls"/>
<pathelement location="${build.home}/test"/>
<pathelement path="/usr/share/java/junit4.jar"/>
</classpath>
<formatter type="xml"/>
2012-01-04 13:27:05 +01:00
<test name="de.hsadmin.remote.ContinuousIntegrationTest" todir="${build.home}/junit" />
2011-05-06 12:28:11 +02:00
</junit>
</target>
2010-10-01 21:42:49 +02:00
</project>