Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
<?xml version="1.0" encoding="utf-8"?>
<!--
Rapla builds are based on the ANT-tool from apache.org.
Ant is a build tool written in java that uses a build-file, like this one.
Ant does all the nasty work like compiling,building and testing the different distributions.
For more information visit "http://jakarata.apache.org".
The rapla-source distribution comes with a copy of ANT located in the lib directory:
ant.jar,optional.jar
You will also find junit.jar
junit.jar is a testing-framework for automated testing used for most of our tests
(currently there are'nt many).
Building instructions
(shamelessly taken from the Apache Cocoon-build-file and replaced cocoon with rapla)
=====================
Ok, let's build the baby. First, make sure your current working directory is
where this very file is located. Then type
./build.sh (unix)
.\build.bat (win32)
if everything is right and all the required packages are visible, this action
will generate a file called "rapla.jar" in the "./build" directory.
Note, that if you do further development, compilation time is reduced since
Ant is able of detecting which files have changed and to recompile them at need.
Also, you'll note that reusing a single JVM instance for each task, increases
tremendously the performance of the whole build system, compared to other
tools (i.e. make or shell scripts) where a new JVM is started for each task.
Building on another directory
=============================
Sometimes you might want to build on an external directory to keep the
distribution clean: no worries, this is just an environment property away.
Suppose you want to use the "../build" directory instead, you simply tipe
[unix] ./build.sh -Dbuild.dir=../build
[win32] .\build.bat -Dbuild.dir=..\build
By using the -Dxxx=yyy argument, you are setting environments in the JVM: Ant
is designed to give higher priority to system environments to allow you to
modify _any_ <property> that you can find in the building instructions below,
so it's just a matter of understanding what property you want to change
and you don't have to touch this file (which you shouldn't need to do).
Build targets
=============
The build system is not only responsible of compiling Rapla into a jar file,
but is also responsible for creating the HTML documentation, javadocs,
distributions and web site. In fact, the file you have here is _exactly_ what
is used by rapla maintainers to take care of everything in the Rapla
project, no less and no more.
To know more about the available targets take a look at this file, which is
pretty self-explanatory or type
[unix] ./build.sh -projecthelp
[win32] .\build.bat -projecthelp
and concentrate on the target descriptions that start with a star '*': these
are the one you should call, the others are internal targets that are called
by the main ones.
Many thanks to the cocoon team
-->
<!-- Rapla build-file
Copyright (C) 2001-2013 Christopher Kohlhaas
This programm is free software; you can redistribute it and/or modify
it under the terns of the GNU General Public License as published by the
Free Software Foundation. A copy of the license has been included with
these distribution in the COPYING file, if not go to www.fsf.org .
As a special exception, you are granted the permission to link this
program with every library, of wich license fullfills the Open Source
Definition as published by the Open Source Initiative (OSI).
-->
<project name="Rapla" default="choose-target" basedir=".">
<!-- This is for the crlf-fix -->
<patternset id="text-files">
<include name="**/*.java" />
<include name="contexts/rapla.xml" />
<include name="build.xml" />
<include name="build.properties.template" />
<include name="buildplugin.xml" />
<include name="**/*.txt" />
<include name="**/*.properties" />
</patternset>
<property name="main.dir" value="${basedir}" />
<target name="properties" if="eclipse.running">
<property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter" />
</target>
<target name="init" depends="properties">
<!-- Create the time stamp -->
<tstamp />
<tstamp>
<format property="BUILD_TIME" pattern="yyyy-MM-dd HH:mm" locale="en" />
</tstamp>
<property name="doc.properties" value="doc.properties" />
<property name="build.properties" value="build.properties" />
<available file="${main.dir}/${build.properties}" property="build.properties.present" />
<copy todir="${main.dir}">
<fileset dir="${main.dir}">
<include name="build.properties.template" unless="build.properties.present" />
</fileset>
<mapper type="glob" from="*.template" to="*" />
</copy>
<property file="${main.dir}/${build.properties}" />
<property file="${main.dir}/${doc.properties}" />
<property name="plugin.base" value="${main.dir}/.." />
<property name="plugin.includes" value="*_plugin" />
<property name="plugin.excludes" value="nothing_plugin" />
<property name="plugin.main.excludes" value="nothing" />
<!-- All the libraries are used for compilation by default-->
<patternset id="default-runtime-libs">
<include name="common/*.jar" />
<include name="server/*.jar" />
<include name="ext/*.jar" />
<include name="logging/*.jar" />
<include name="test-only/junit*.jar"/>
<exclude name="ant*.jar" />
<include name="*.jar" />
</patternset>
<!-- Information about the compiler -->
<!-- property name="build.compiler" value="javac1.3"/-->
<property name="debug" value="on" />
<property name="optimize" value="off" />
<property name="deprecation" value="off" />
<property name="verbose" value="no" />
<property name="target_vm" value="1.6" />
<property name="packages" value="org.*" />
<!-- The rapla-directories -->
<property name="src.dir" value="${main.dir}/src" />
<property name="webappsrc.dir" value="${main.dir}/war" />
<property name="webapp.default_css" value="${webappsrc.dir}/default.css" />
<property name="lib.dir" value="${main.dir}/lib" />
<property name="build.dir" value="${main.dir}/build" />
<property name="dist.dir" value="${main.dir}/dist" />
<property name="temp.dir" value="${main.dir}/temp" />
<property name="testsrc.dir" value="${main.dir}/test-src" />
<property name="test.dir" value="${basedir}/test" />
<property name="test-dist-src.dir" value="${test.dir}/rapla-source-test" />
<property name="build.src" value="${build.dir}/src" />
<property name="build.javadocs" value="${main.dir}/javadoc" />
<property name="build.dest.main" value="${build.dir}/classes" />
<property name="build.dest.client" value="${build.dir}/clientclasses" />
<property name="build.dest.bootstrap" value="${build.dir}/bootstrap" />
<property name="build.dest.test" value="${build.dir}/test/classes" />
<property name="dist-src.dir" value="${dist.dir}/rapla-source-${doc.version}" />
<property name="dist-bin.dir" value="${dist.dir}/rapla-binary-${doc.version}" />
<property name="webapp.dir" value="${build.dir}/war" />
<property name="keystore.file" value="${main.dir}/testkeystore" />
<property name="keystore.password" value="secret" />
<property name="keystore.keypass" value="${keystore.password}" />
<property name="application.name" value="Rapla" />
<property name="main.lib" value="rapla-${doc.version}.jar" />
<property name="main.client.lib" value="raplaclient.jar" />
<property name="target" value="dist-bin" />
<available file="${keystore.file}" property="keystore.present" />
<condition property="permissions.client" value="all-permissions" else="sandbox">
<available file="${keystore.file}"/>
</condition>
<!-- filters will replace tokens in source files with the values in doc.properties -->
<filterset id="docfilter">
<filter token="doc.name" value="${doc.name}" />
<filter token="doc.date" value="${doc.date}" />
<filter token="doc.version" value="${doc.version}" />
<filter token="doc.buildtime" value="${BUILD_TIME}" />
<filter token="doc.year" value="${doc.year}" />
<filter token="doc.copyright" value="${doc.copyright}" />
<filter token="doc.developer-list-link" value="${doc.developer-list-link}" />
<filter token="doc.developer-list" value="${doc.developer-list}" />
<filter token="doc.homepage" value="${doc.homepage}" />
</filterset>
</target>
<target name="clean_on_demand" if="clean.everytime">
<echo message="clean.everytime specified in build so clean is called"/>
<antcall target="clean" />
</target>
<target name="choose-target" depends="init,clean_on_demand" description="Executes the target specified in build.properties. Default is dist-bin.">
<antcall target="${target}" />
</target>
<!-- =================================================================== -->
<!-- The Targets prepare,compile,compile-resources and build are for -->
<!-- creating the ${main.lib} -->
<!-- =================================================================== -->
<target name="prepare" depends="init">
<mkdir dir="${temp.dir}" />
<mkdir dir="${build.dir}" />
<mkdir dir="${build.dest.main}" />
<mkdir dir="${build.dest.client}" />
<mkdir dir="${build.dest.bootstrap}" />
<mkdir dir="${build.dest.main}/META-INF" />
<mkdir dir="${build.dest.client}/META-INF" />
</target>
<target name="compile" depends="prepare">
<javac srcdir="${src.dir}" destdir="${build.dest.bootstrap}" debug="${debug}" source="${target_vm}" target="${target_vm}" optimize="${optimize}" deprecation="${deprecation}" verbose="${verbose}" includeAntRuntime="false">
<include name="org/rapla/bootstrap/*"/>
</javac>
<javac srcdir="${src.dir}" sourcepath="" destdir="${build.dest.client}" debug="${debug}" source="${target_vm}" target="${target_vm}" optimize="${optimize}" deprecation="${deprecation}" verbose="${verbose}" includeAntRuntime="false">
<classpath>
<fileset dir="${lib.dir}">
<include name="common/*.jar" />
</fileset>
</classpath>
<exclude name="org/rapla/bootstrap/*"/>
<exclude name="**/Slf4jAdapter**" />
<exclude name="**/server/**" />
<exclude name="**/server/**" />
<exclude name="**/storage/xml/**" />
<exclude name="**/storage/dbfile/**" />
<exclude name="**/storage/dbsql/**" />
<exclude name="**/servletpages/**" />
<exclude name="se/jiderhamn/**"/>
<include name="**" />
</javac>
<!-- now compile the rest -->
<javac srcdir="${src.dir}" sourcepath="" destdir="${build.dest.main}" debug="${debug}" source="${target_vm}" target="${target_vm}" optimize="${optimize}" deprecation="${deprecation}" verbose="${verbose}" includeAntRuntime="false">
<classpath>
<fileset dir="${lib.dir}">
<include name="client/*.jar" />
<include name="common/*.jar" />
<include name="server/*.jar" />
<include name="logging/slf4j-api-*.jar" />
<include name="servlet-api-*.jar" />
</fileset>
</classpath>
<exclude name="org/rapla/bootstrap/*"/>
</javac>
<!-- The png,license,xsl and rng files must be in the correct classpath -->
<copy todir="${build.dest.main}">
<fileset dir="${src.dir}">
<exclude name="org/rapla/bootstrap"/>
<exclude name="org/rapla/bootstrap/**"/>
<exclude name="**/*.java" />
<exclude name="**/*Resources.xml" />
<exclude name="**/package.html" />
<exclude name="**/overview.html" />
<exclude name="**/DEPENDENCIES" />
<exclude name="**/ical4j.properties" />
<exclude name="**/commons-logging.properties" />
</fileset>
</copy>
<copy todir="${build.dest.main}/META-INF">
<fileset dir="${main.dir}/legal">
<include name="readme.txt"/>
<include name="license.txt"/>
</fileset>
</copy>
<copy todir="${build.dest.bootstrap}">
<fileset dir="${src.dir}">
<include name="org/rapla/bootstrap/**"/>
<exclude name="**/*.java" />
</fileset>
</copy>
</target>
<!-- Set a variable if plugin meta is already up-to-date. -->
<target name="pluginmeta-check" depends="prepare">
<condition property="pluginmeta.notrequired">
<and>
<uptodate>
<srcfiles dir="${build.dest.main}" includes="**/*Plugin.class" />
<mapper type="merge" to="${build.dest.main}/META-INF/rapla-plugin.list" />
</uptodate>
</and>
</condition>
</target>
<target name="generate-plugin-meta" unless="pluginmeta.notrequired" description="Generate the rapla-plugin.list" depends="pluginmeta-check,compile">
<echo message="generating Plugin Metainfo" />
<mkdir dir="${temp.dir}/META-INF" />
<java classname="org.rapla.framework.ServiceListCreator" failonerror="true" fork="yes">
<arg value="${build.dest.main}" />
<arg value="${temp.dir}/META-INF/rapla-plugin.list" />
<classpath>
<pathelement path="${build.dest.main}" />
</classpath>
</java>
<copy file="${temp.dir}/META-INF/rapla-plugin.list" tofile="${build.dest.main}/META-INF/rapla-plugin.list">
<filterchain>
<linecontainsregexp negate="true">
<regexp pattern="org\.rapla\.plugin\.(${plugin.main.excludes})\..*"/>
</linecontainsregexp>
</filterchain>
</copy>
</target>
<!-- Set a variable if resources are already up-to-date. -->
<target name="resources-check" depends="init">
<condition property="resources.notrequired">
<and>
<uptodate>
<srcfiles dir="${src.dir}">
<include name="**/*Resources.xml" />
</srcfiles>
<mapper type="glob" from="*Resources.xml" to="${build.dest.main}/*Resources.properties" />
</uptodate>
<uptodate property="test" srcfile="${main.dir}/${doc.properties}" targetfile="${build.dest.main}/org/rapla/RaplaResources.properties" />
</and>
</condition>
</target>
<available file="${basedir}/.svn" property="svn.entries.present"/>
<available file="${basedir}/.git" type="dir" property="git.present"/>
<target name="svn.revision" if="svn.entries.present">
<delete file="${temp.dir}/svninfo.xml"/>
<exec executable="svn" output="${temp.dir}/svninfo.xml" failifexecutionfails="false" logerror="false" searchpath="true" resolveexecutable="true">
<arg line="info --xml" />
</exec>
<xmlproperty file="${temp.dir}/svninfo.xml" collapseattributes="true" />
</target>
<target name="git.revision" if="git.present">
<exec executable="git" outputproperty="git.revision" failifexecutionfails="false" logerror="false" searchpath="true" resolveexecutable="true" errorproperty="">
<arg value="describe"/>
<arg value="--tags"/>
<arg value="--always"/>
<arg value="HEAD"/>
</exec>
<condition property="info.entry.commit.revision" value="${git.revision}" else="unknown">
<and>
<isset property="git.revision"/>
<length string="${git.revision}" trim="yes" length="0" when="greater"/>
</and>
</condition>
</target>
<target name="revision-number-filter1" depends="svn.revision,git.revision" if="info.entry.commit.revision">
<filterset id="revisionfilter">
<filter token="doc.revision" value="${info.entry.commit.revision}" />
</filterset>
</target>
<target name="revision-number-filter2" depends="svn.revision,git.revision" unless="info.entry.commit.revision">
<filterset id="revisionfilter">
<filter token="doc.revision" value="-" />
</filterset>
</target>
<target name="compile-resources" unless="resources.notrequired" description="Generate and compile the RaplaResources" depends="svn.revision,git.revision,revision-number-filter1,revision-number-filter2,resources-check,compile">
<echo message="generating Resourcefiles" />
<java classname="org.rapla.components.xmlbundle.impl.ResourceFileGenerator" failonerror="true" fork="yes">
<arg value="${src.dir}" />
<arg value="${temp.dir}/unfiltered-resources" />
<classpath>
<pathelement path="${build.dest.main}" />
</classpath>
</java>
<uptodate property="resources.rebuild">
<srcfiles dir="${build.dest.main}" includes="**/*Resources*.properties" />
<mapper type="merge" to="{$main.dir}/${doc.properties}" />
</uptodate>
<echo message="Applying filter to ResourceFiles" />
<copy todir="${build.dest.main}">
<fileset dir="${temp.dir}/unfiltered-resources">
<include name="**/*.properties" />
</fileset>
<filterset refid="docfilter" />
<filterset refid="revisionfilter" />
</copy>
<!-- <delete dir="${temp.dir}/languages" /> -->
</target>
<target name="build" depends="compile,compile-resources,generate-plugin-meta">
<mkdir dir="${build.src}" />
<jar jarfile="${build.dir}/${main.lib}">
<fileset dir="${build.dest.main}">
<exclude name="org/rapla/bootstrap/*" />
</fileset>
<manifest>
<attribute name="Created-By" value="${user.name}" />
<section name="common">
<attribute name="Implementation-Title" value="common" />
<attribute name="Implementation-Version" value="${doc.version} ${TODAY}" />
<attribute name="url" value="${doc.homepage}"/>
<attribute name="Codebase" value="*"/>
<attribute name="Application-Name" value ="${application.name}"/>
<attribute name="Permissions" value="all-permissions"/>
<attribute name="Bundle-License" value="http://www.gnu.org/licenses/gpl.html"/>
</section>
</manifest>
</jar>
<copy todir="${build.dest.client}">
<fileset dir="${build.dest.main}">
<exclude name="**/*.class" />
<exclude name="**/server" />
<exclude name="**/server/**" />
<exclude name="se"/>
<exclude name="se/jiderhamn"/>
<exclude name="se/jiderhamn/**"/>
<exclude name="org/rapla/storage/xml"/>
<exclude name="org/rapla/storage/xml/**"/>
<exclude name="org/rapla/storage/dbfile"/>
<exclude name="org/rapla/storage/dbfile/**" />
<exclude name="org/rapla/storage/dbsql"/>
<exclude name="org/rapla/storage/dbsql/**" />
<exclude name="org/rapla/servletpages" />
<exclude name="org/rapla/servletpages/**" />
</fileset>
</copy>
<jar jarfile="${build.dir}/${main.client.lib}">
<fileset dir="${build.dest.client}">
</fileset>
<manifest>
<attribute name="Created-By" value="${user.name}" />
<section name="common">
<attribute name="Implementation-Title" value="common" />
<attribute name="Implementation-Version" value="${doc.version} ${TODAY}" />
<attribute name="url" value="${doc.homepage}"/>
<attribute name="Bundle-License" value="http://www.gnu.org/licenses/gpl.html"/>
</section>
<attribute name="Application-Name" value ="${application.name}"/>
<attribute name="Codebase" value="*"/>
<attribute name="Permissions" value="${permissions.client}"/>
</manifest>
</jar>
<jar jarfile="${build.dir}/raplabootstrap.jar">
<fileset dir="${build.dest.bootstrap}">
</fileset>
<manifest>
<attribute name="Created-By" value="${user.name}" />
<attribute name="Main-Class" value="org.rapla.bootstrap.RaplaStandaloneLoader" />
<section name="common">
<attribute name="Implementation-Title" value="common" />
<attribute name="Implementation-Version" value="${doc.version} ${TODAY}" />
<attribute name="url" value="${doc.homepage}"/>
<attribute name="Bundle-License" value="http://www.gnu.org/licenses/gpl.html"/>
</section>
<attribute name="Application-Name" value ="${application.name}"/>
<attribute name="Codebase" value="*"/>
<attribute name="Permissions" value="all-permissions"/>
</manifest>
</jar>
</target>
<target name="build-plugins" depends="compile">
<subant target="build" genericantfile="buildplugin.xml">
<dirset dir="${plugin.base}" includes="${plugin.includes}" excludes="${plugin.excludes}"/>
<property name="rapla.dir" value="${main.dir}"/>
<property name="rapla.build.dir" value="${build.dir}"/>
<property name="plugin.base" value="${plugin.base}"/>
<property name="permissions.client" value="${permissions.client}"/>
<property name="application.name" value="${application.name}"/>
</subant>
</target>
<target name="build-plugins-sub" depends="prepare">
<echo message="Building dependencies ${plugin.dependencies.sub}"/>
<subant target="compile" genericantfile="${main.dir}/buildplugin.xml" inheritAll="false" inheritRefs="false">
<dirset dir="${plugin.base}" includes="${plugin.dependencies.sub}" />
<property name="rapla.dir" value="${main.dir}"/>
<property name="rapla.build.dir" value="${build.dir}"/>
<property name="plugin.base" value="${plugin.base}"/>
<property name="permissions.client" value="${permissions.client}"/>
<property name="application.name" value="${application.name}"/>
</subant>
</target>
<target name="run" depends="dist-bin" description="build and run binary-distribution">
<java classname="org.rapla.bootstrap.RaplaStandaloneLoader" fork="yes" dir="${dist-bin.dir}">
<classpath>
<fileset dir="${dist-bin.dir}">
<include name="raplabootstrap.jar"/>
</fileset>
</classpath>
</java>
</target>
<!-- =================================================================== -->
<!-- Build the webapps folder -->
<!-- =================================================================== -->
<target name="webapp" depends="build" description="Build the rapla web-application">
<mkdir dir="${webapp.dir}" />
<mkdir dir="${webapp.dir}/WEB-INF" />
<mkdir dir="${webapp.dir}/META-INF" />
<mkdir dir="${webapp.dir}/webclient" />
<mkdir dir="${webapp.dir}/WEB-INF/lib" />
<mkdir dir="${webapp.dir}/WEB-INF/classes" />
<!-- this also includes the build of the plugins -->
<subant target="copytowebapp" genericantfile="buildplugin.xml" inheritAll="false" inheritRefs="false">
<dirset dir="${plugin.base}" includes="${plugin.includes}" excludes="${plugin.excludes}"/>
<property name="rapla.dir" value="${main.dir}"/>
<property name="rapla.build.dir" value="${build.dir}"/>
<property name="webapp.dir" value="${webapp.dir}"/>
<property name="plugin.base" value="${plugin.base}"/>
<property name="permissions.client" value="${permissions.client}"/>
<property name="application.name" value="${application.name}"/>
</subant>
<copy todir="${webapp.dir}">
<fileset dir="${webappsrc.dir}">
<exclude name="WEB-INF/classes/**" />
<exclude name="default.css" />
<include name="**" />
</fileset>
</copy>
<copy tofile="${webapp.dir}/default.css" file="${webapp.default_css}"/>
<copy todir="${webapp.dir}/webclient">
<fileset dir="${lib.dir}/common">
<include name="*.jar" />
</fileset>
<fileset dir="${build.dir}">
<include name="${main.client.lib}" />
</fileset>
</copy>
<jar jarfile="${webapp.dir}/webclient/javax.inject.jar" update="true">
<manifest>
<attribute name="Permissions" value="${permissions.client}"/>
<attribute name="Application-Name" value ="${application.name}"/>
<attribute name="Codebase" value="*"/>
</manifest>
</jar>
<jar jarfile="${webapp.dir}/webclient/iText-4.2.0-com.itextpdf.jar" update="true">
<manifest>
<attribute name="Permissions" value="${permissions.client}"/>
<attribute name="Application-Name" value ="${application.name}"/>
<attribute name="Codebase" value="*"/>
</manifest>
</jar>
<jar jarfile="${webapp.dir}/webclient/gson-2.3.jar" update="true">
<manifest>
<attribute name="Permissions" value="${permissions.client}"/>
<attribute name="Application-Name" value ="${application.name}"/>
<attribute name="Codebase" value="*"/>
</manifest>
</jar>
<jar jarfile="${webapp.dir}/webclient/super-csv-2.0.1.jar" update="true">
<manifest>
<attribute name="Permissions" value="${permissions.client}"/>
<attribute name="Application-Name" value ="${application.name}"/>
<attribute name="Codebase" value="*"/>
</manifest>
</jar>
<!--
-->
<copy file="${src.dir}/org/rapla/gui/images/tafel.png" tofile="${webapp.dir}/webclient/logo.png" />
<copy todir="${webapp.dir}/WEB-INF/lib">
<fileset dir="${lib.dir}/common">
<include name="*.jar" />
</fileset>
<fileset dir="${lib.dir}/server">
<exclude name="mailapi*.jar" if="mailapi.exclude"/>
<exclude name="smtp*.jar" if="mailapi.exclude"/>
<include name="*.jar"/>
</fileset>
<fileset dir="${build.dir}">
<include name="${main.lib}" />
</fileset>
</copy>
<copy todir="${webapp.dir}/WEB-INF/classes">
<fileset dir="${src.dir}">
<include name="**/ical4j.properties" />
<include name="**/commons-logging.properties" />
</fileset>
<fileset dir="${webappsrc.dir}/WEB-INF">
<include name="raplaserver.xconf" />
</fileset>
</copy>
<uptodate property="clientlib.uptodate" targetfile="${webapp.dir}/WEB-INF/classes/clientlibs.properties">
<srcfiles dir="${webapp.dir}/webclient" includes="*.jar"/>
</uptodate>
</target>
<target name="sign" if="keystore.present">
<signjar
alias="rapla" keystore="${keystore.file}"
storepass="${keystore.password}"
keypass="${keystore.keypass}"
lazy="true"
>
<path>
<fileset dir="${webapp.dir}/webclient" includes="**/*.jar" />
<!-- server jars need to be signed as well-->
<fileset dir="${webapp.dir}/WEB-INF/lib" includes="**/*.jar" />
</path>
</signjar>
</target>
<target name="updateclientlibs" depends="webapp" unless="clientlib.uptodate">
<path id="dist.contents">
<fileset dir="${webapp.dir}/webclient">
<include name="*.jar"/>
</fileset>
</path>
<path id="dist.contents.dir">
<dirset dir="${webapp.dir}/webclient">
</dirset>
</path>
<property name="prop.dist.contents" refid="dist.contents"/>
<property name="prop.dist.contents.dir" refid="dist.contents.dir"/>
<echo file="${webapp.dir}/WEB-INF/classes/clientlibs.properties">${prop.dist.contents}</echo>
<replace file="${webapp.dir}/WEB-INF/classes/clientlibs.properties" token="${prop.dist.contents.dir}${file.separator}" value="" preserveLastModified="true"/>
<replace file="${webapp.dir}/WEB-INF/classes/clientlibs.properties" token="${path.separator}" value=";" preserveLastModified="true"/>
</target>
<target name="war" depends="webapp,updateclientlibs,sign" description="Pack the war">
<war destfile="${build.dir}/rapla.war">
<fileset dir="${webapp.dir}"/>
</war>
</target>
<!-- =================================================================== -->
<!-- Create the basic binary distribution that can run Rapla -->
<!-- =================================================================== -->
<target name="dist-bin" depends="webapp,war" description="Build the binary distribution">
<mkdir dir="${dist-bin.dir}" />
<mkdir dir="${dist-bin.dir}/data" />
<mkdir dir="${dist-bin.dir}/webapps" />
<copy todir="${dist-bin.dir}/webapps">
<fileset dir="${build.dir}" >
<include name="rapla.war" />
</fileset>
</copy>
<mkdir dir="${dist-bin.dir}/service" />
<copy todir="${dist-bin.dir}/service">
<fileset dir="${main.dir}/service" >
<include name="**" />
</fileset>
</copy>
<mkdir dir="${dist-bin.dir}/lib" />
<copy todir="${dist-bin.dir}/lib">
<fileset dir="${lib.dir}">
<include name="servlet-api-*.jar" />
<include name="jetty*.jar" />
</fileset>
</copy>
<mkdir dir="${dist-bin.dir}/lib/logging" />
<copy todir="${dist-bin.dir}/lib/logging">
<fileset dir="${lib.dir}/logging">
<include name="logback*.jar" />
<include name="*slf4j*.jar" />
</fileset>
</copy>
<mkdir dir="${dist-bin.dir}/lib/ext" />
<copy todir="${dist-bin.dir}/lib/ext">
<fileset dir="${lib.dir}/ext">
<include name="*.jar" />
</fileset>
</copy>
<mkdir dir="${dist-bin.dir}/etc" />
<copy todir="${dist-bin.dir}/etc">
<fileset dir="${main.dir}/etc" >
<include name="jetty.xml" />
<include name="webdefault.xml" />
</fileset>
</copy>
<mkdir dir="${dist-bin.dir}/resources" />
<copy todir="${dist-bin.dir}/resources">
<fileset dir="${main.dir}/resources" >
<include name="logback.xml" />
<include name="logback-access.xml" />
</fileset>
</copy>
<copy todir="${dist-bin.dir}/contexts">
<fileset dir="${main.dir}/contexts" >
<include name="*.xml_" />
<exclude name="rapla-develop.xml" />
</fileset>
<mapper type="glob" from="*.xml_" to="*.xml" />
</copy>
<mkdir dir="${dist-bin.dir}/logs" />
<copy todir="${dist-bin.dir}">
<fileset dir="${build.dir}">
<include name="raplabootstrap.jar" />
</fileset>
<fileset dir="${main.dir}/templates">
<include name="rapla*.exe" />
<include name="rapla*.l4j.ini" />
</fileset>
<fileset dir="${main.dir}">
<include name="README**" />
<include name="INSTALL**" />
<include name="legal/**" />
</fileset>
</copy>
<!-- It's the same excutable with different config files-->
<copy file="${dist-bin.dir}/rapla.exe" tofile="${dist-bin.dir}/raplaclient.exe"/>
<copy todir="${dist-bin.dir}">
<fileset dir="${main.dir}/templates/scripts">
<include name="raplaserver_*" />
</fileset>
<mapper type="glob" from="raplaserver_*" to="raplaserver.*" />
</copy>
<copy todir="${dist-bin.dir}">
<fileset dir="${main.dir}/templates/scripts">
<include name="raplaclient_*" />
</fileset>
<mapper type="glob" from="raplaclient_*" to="raplaclient.*" />
</copy>
<copy todir="${dist-bin.dir}">
<fileset dir="${main.dir}/templates/scripts">
<include name="rapla_*" />
</fileset>
<mapper type="glob" from="rapla_*" to="rapla.*" />
</copy>
<copy todir="${dist-bin.dir}">
<fileset dir="${main.dir}/templates/scripts">
<include name="raplaimport_*" />
</fileset>
<mapper type="glob" from="raplaimport_*" to="raplaimport.*" />
</copy>
<copy todir="${dist-bin.dir}">
<fileset dir="${main.dir}/templates/scripts">
<include name="raplaexport_*" />
</fileset>
<mapper type="glob" from="raplaexport_*" to="raplaexport.*" />
</copy>
<fixcrlf srcdir="${dist-bin.dir}" eol="crlf">
<include name="*.bat" />
</fixcrlf>
<fixcrlf srcdir="${dist-bin.dir}" eol="lf">
<include name="*.sh" />
</fixcrlf>
<chmod perm="u+x">
<fileset dir="${dist-bin.dir}">
<include name="*.sh" />
<include name="*.bat" />
</fileset>
</chmod>
</target>
<!-- =================================================================== -->
<!-- Create the source distribution -->
<!-- =================================================================== -->
<target name="dist-src" depends="prepare" description="Build the source distribution">
<mkdir dir="${dist-src.dir}" />
<copy todir="${dist-src.dir}/lib">
<fileset dir="${lib.dir}">
<include name="*.jar" />
<include name="common/**" />
<include name="server/**" />
<include name="ext/**" />
<include name="logging/**" />
<include name="test-only/junit*" />
</fileset>
</copy>
<copy todir="${dist-src.dir}">
<fileset dir="${main.dir}">
<include name="src/**" />
<include name="test-src/**" />
<include name="templates/**" />
<include name="legal/**" />
<include name="README**" />
<include name="INSTALL.txt" />
<include name="doc.properties" />
<include name=".project" />
<include name=".classpath" />
<include name="etc/**" />
<include name="bin/*" />
<include name="build.xml" />
<include name="buildplugin.xml" />
<include name="build.properties.template" />
<include name="raplaselfsigned.ks" />
<include name="build.sh" />
<include name="build.bat" />
<include name="war/**" />
<exclude name="war/WEB-INF/lib/**" />
<exclude name="war/WEB-INF/classes" />
<exclude name="war/WEB-INF/classes/**" />
<include name="resources/**" />
<include name="contexts/rapla-develop.xml" />
<include name="contexts/rapla.xml_" />
<include name="service/**" />
</fileset>
</copy>
<chmod perm="u+x">
<fileset dir="${dist-src.dir}">
<include name="**/*.bat" />
<include name="**/*.sh" />
<include name="bin/ant" />
<include name="bin/antRun" />
</fileset>
</chmod>
<fixcrlf srcdir="${dist-src.dir}" eol="crlf">
<include name="*.bat" />
</fixcrlf>
<fixcrlf srcdir="${dist-src.dir}" eol="lf">
<include name="*.sh" />
<include name="bin/ant" />
<include name="bin/antRun" />
</fixcrlf>
</target>
<!-- =================================================================== -->
<!-- Packages the distribution as .zip and tar.gz -->
<!-- =================================================================== -->
<target name="tarball">
<fixcrlf srcdir="${tarball.dir}" eol="lf" eof="remove">
<patternset refid="text-files" />
<include name="**/*.sh" />
<include name="**/ant" />
<include name="**/antRun" />
<exclude name="**/*.bat" />
</fixcrlf>
<tar tarfile="${dist.dir}/${tarball.name}.tar.gz" compression="gzip" longfile="gnu">
<tarfileset dir="${tarball.dir}/..">
<!-- This is a workaround until tarfileset supports the prefix-->
<include name="${tarball.name}/**" />
<exclude name="${tarball.name}/**/*.sh" />
<exclude name="${tarball.name}/**/*.bat" />
<exclude name="${tarball.name}/**/ant" />
<exclude name="${tarball.name}/**/antRun" />
</tarfileset>
<tarfileset dir="${tarball.dir}/.." mode="755">
<include name="${tarball.name}/**/*.sh" />
<include name="${tarball.name}/**/*.bat" />
<include name="${tarball.name}/**/ant" />
<include name="${tarball.name}/**/antRun" />
</tarfileset>
</tar>
<fixcrlf srcdir="${tarball.dir}" eol="crlf">
<patternset refid="text-files" />
<exclude name="**/*.sh" />
<exclude name="**/ant" />
<exclude name="**/antRun" />
</fixcrlf>
<zip zipfile="${dist.dir}/${tarball.name}.zip">
<!-- This is a workaround until tarfileset supports the prefix-->
<zipfileset dir="${tarball.dir}" prefix="${tarball.name}" />
</zip>
<fixcrlf srcdir="${tarball.dir}">
<patternset refid="text-files" />
</fixcrlf>
</target>
<target name="tarballs" description="Generate all tarballs for download" depends="init,dist-bin,dist-src">
<antcall target="tarball">
<param name="tarball.name" value="rapla-binary-${doc.version}" />
<param name="tarball.dir" value="${dist-bin.dir}" />
</antcall>
<antcall target="tarball">
<param name="tarball.name" value="rapla-source-${doc.version}" />
<param name="tarball.dir" value="${dist-src.dir}" />
</antcall>
</target>
<!-- =================================================================== -->
<!-- Creates the API documentation -->
<!-- =================================================================== -->
<target name="javadocs" depends="prepare" description="Generate the API documentation">
<!-- Filter-Information for the java-doc generator and the rapla-language-files-->
<delete dir="${build.src}" />
<mkdir dir="${build.src}" />
<mkdir dir="${build.javadocs}" />
<copy todir="${build.src}">
<fileset dir="${src.dir}">
<include name="**/*.java" />
<include name="**/package.html" />
<include name="**/overview.html" />
</fileset>
<filterset refid="docfilter" />
</copy>
<copy file="${src.dir}/org/rapla/gui/images/tafel.png" tofile="${build.javadocs}/logo.png" />
<javadoc packagenames="${packages}" destdir="${build.javadocs}" author="true" version="true" use="false" noindex="true" windowtitle="${doc.name} API (${doc.version})" bottom="Copyright &#169; ${doc.year} ${doc.copyright}. All Rights Reseserved." overview="${build.src}/org/rapla/overview.html">
<packageset dir="${build.src}" defaultexcludes="yes">
<include name="org/rapla" />
<include name="org/rapla/bootstrap" />
<include name="org/rapla/facade" />
<include name="org/rapla/entities" />
<include name="org/rapla/entities/domain" />
<include name="org/rapla/entities/dynamictype" />
<include name="org/rapla/entities/configuration" />
<include name="org/rapla/framework" />
<include name="org/rapla/framework/logger" />
<include name="org/rapla/examples" />
<include name="org/rapla/components/xmlbundle" />
<include name="org/rapla/components/util" />
<include name="org/rapla/components/util/undo" />
<include name="org/rapla/components/util/iterator" />
<include name="org/rapla/components/calendar" />
<include name="org/rapla/components/iolayer" />
<include name="org/rapla/components/layout" />
<include name="org/rapla/components/tablesorter" />
<include name="org/rapla/plugin" />
<include name="org/rapla/plugin/mail" />
<include name="org/rapla/plugin/tableview" />
<include name="org/rapla/gui" />
<include name="org/rapla/gui/images" />
<include name="org/rapla/gui/toolkit" />
<include name="org/rapla/client" />
<include name="org/rapla/server" />
<include name="org/rapla/servletpages" />
<include name="org/rapla/examples" />
<include name="org/rapla/entities" />
<exclude name="**/internal/**" />
<exclude name="**/impl/**" />
<exclude name="**/print/**" />
</packageset>
<classpath>
<fileset dir="${lib.dir}">
<patternset refid="default-runtime-libs" />
</fileset>
</classpath>
<link href="http://docs.oracle.com/javase/7/docs/api/" />
</javadoc>
</target>
<!-- =================================================================== -->
<!-- Test -->
<!-- =================================================================== -->
<target name="compile-tests" depends="prepare,compile,compile-resources,generate-plugin-meta">
<mkdir dir="${build.dest.test}" />
<javac srcdir="${testsrc.dir}" destdir="${build.dest.test}" debug="${debug}" source="${target_vm}" target="${target_vm}" optimize="${optimize}" deprecation="${deprecation}" includeAntRuntime="false">
<classpath>
<fileset dir="${lib.dir}">
<patternset refid="default-runtime-libs" />
</fileset>
<pathelement path="${build.dest.main}" />
</classpath>
</javac>
</target>
<target name="check-test" unless="test.class">
<echo message="You must specify a test.class. Example: build -Dtest.class=mypackage.MyTest test " />
</target>
<target name="test" if="test.class" description="Run one JUnit-Test" depends="compile-tests,check-test">
<junit printsummary="no" haltonfailure="yes" fork="yes" dir="${main.dir}">
<classpath>
<pathelement path="${build.dest.main}" />
<pathelement path="${main.dir}/resources" />
<pathelement path="${build.dest.test}" />
<fileset dir="${lib.dir}">
<patternset refid="default-runtime-libs" />
</fileset>
</classpath>
<formatter type="plain" usefile="no" />
<test name="${test.class}" />
</junit>
<echo message="Tests complete" />
</target>
<target name="test-all" description="Run all JUnit-Tests" depends="clean-test,compile-tests">
<junit printsummary="no" haltonfailure="yes" fork="yes" dir="${main.dir}">
<classpath>
<pathelement path="${build.dest.main}" />
<pathelement path="${main.dir}/resources" />
<pathelement path="${build.dest.test}" />
<fileset dir="${lib.dir}">
<patternset refid="default-runtime-libs" />
</fileset>
</classpath>
<formatter type="plain" usefile="no" />
<batchtest>
<fileset dir="${build.dest.test}">
<include name="**/*Test.class" />
<exclude name="**/*$$*Test.class" />
<exclude name="**/Abstract**.class" />
</fileset>
</batchtest>
</junit>
<echo message="Tests complete" />
</target>
<!-- ===================================================================
Tests the build-process of the binary and the source-distribution.
Performs the following steps:
1. clean the test directory
2. build a source-distribution in the test directory
3. start the test (target test-all)
4. build a binary-distribution out of the source-distribution
5. start the binary-distribution and test for exceptions
6. clean the test dir
=================================================================== -->
<target name="test-build" description="Tests the build-process of the binary and the source-distribution" depends="init">
<delete dir="${test.dir}" />
<mkdir dir="${test.dir}" />
<mkdir dir="${test-dist-src.dir}" />
<ant antfile="build.xml" target="dist-src">
<property name="dist-src.dir" value="${test-dist-src.dir}" />
</ant>
<ant antfile="${test-dist-src.dir}/build.xml" target="test-all" dir="${test-dist-src.dir}" inheritAll="false">
<property name="main.dir" value="${test-dist-src.dir}" />
</ant>
<ant antfile="${test-dist-src.dir}/build.xml" target="dist-bin" dir="${test-dist-src.dir}" inheritAll="false" />
<ant antfile="${test-dist-src.dir}/build.xml" target="run" dir="${test-dist-src.dir}" inheritAll="false" />
<!-- frees the space requiered by testing -->
<delete dir="${test.dir}" />
</target>
<!-- =================================================================== -->
<!-- Cleanup -->
<!-- =================================================================== -->
<target name="clean" description="Clean the build directory" depends="init">
<delete dir="${build.dir}" />
<delete dir="${temp.dir}" />
<subant target="clean" genericantfile="buildplugin.xml">
<dirset dir="${plugin.base}" includes="${plugin.includes}"/>
<property name="rapla.dir" value="${main.dir}"/>
<property name="rapla.build.dir" value="${build.dir}"/>
</subant>
</target>
<target name="clean-dist" description="Clean the dist directory" depends="init">
<delete dir="${dist.dir}" />
</target>
<target name="clean-test" depends="init">
<delete dir="${test.dir}" />
</target>
</project>