blob: 6d45bd1958ea2a0752170eb5959e7d6d9eb85e26 [file] [log] [blame]
<?xml version="1.0" encoding="ISO-8859-1"?>
<project default="javaapp"
xmlns:ant="jelly:ant" xmlns:j="jelly:core">
<preGoal name="test:test">
<ant:mkdir dir="logs"/>
<ant:touch file="logs/apacheds.log"/>
</preGoal>
<preGoal name="javaapp">
<attainGoal name="java:compile"/>
</preGoal>
<goal name="jar:jar">
<attainGoal name="javaapp"/>
</goal>
<goal name="clean">
<ant:delete dir="eve"/>
<ant:delete dir="logs"/>
<ant:delete dir="server-work"/>
<ant:delete>
<fileset dir="." includes="*.db"/>
<fileset dir="." includes="*.lg"/>
</ant:delete>
<delete dir="target" />
</goal>
<!-- Build a standalone jar for the server -->
<goal name="standalone" prereqs="clean, java:compile">
<j:set var="classpath" value="" />
<j:forEach var="lib" items="${pom.artifacts}">
<j:set var="dep" value="${lib.dependency}"/>
<j:set var="classpath" value="${classpath} lib/${dep.artifactId}-${dep.version}.jar"/>
<ant:copy todir="target/standalone/lib" file="${lib.path}"/>
</j:forEach>
<copy file="src/main/resources/log4j.properties" todir="target/classes" />
<j:set var="dynamicManifest" value="target/executable_manifest.MF" />
<echo file="${dynamicManifest}">Main-Class: org.apache.ldap.server.ServerMain
Class-Path: log4j.properties ${classpath}
</echo>
<attainGoal name="server-scripts" />
<copy file="server.xml" tofile="target/standalone/apacheds-server.xml" />
<jar destfile="target/standalone/${pom.artifactId}-${pom.currentVersion}.jar" manifest="${dynamicManifest}">
<fileset dir="target/classes"/>
</jar>
<zip destfile="target/apacheds-standalone-${pom.currentVersion}.zip"
basedir="target/standalone"/>
</goal>
<!-- create an apacheds-startup.sh and an apacheds-server.bat -->
<goal name="server-scripts">
<copy file="src/main/resources/apacheds-server.sh" todir="target/standalone" />
<copy file="src/main/resources/apacheds-server.bat" todir="target/standalone" />
<replace file="target/standalone/apacheds-server.sh"
token="@APACHE_DS_MAIN_JAR@" value="${pom.artifactId}-${pom.currentVersion}.jar"/>
<replace file="target/standalone/apacheds-server.bat"
token="@APACHE_DS_MAIN_JAR@" value="${pom.artifactId}-${pom.currentVersion}.jar"/>
<chmod file="target/standalone/apacheds-server.sh" perm="ugo+rwx"/>
</goal>
</project>