blob: a3f45e1fc1905b27492c31654965bde6a8ab58b5 [file] [log] [blame]
<?xml version="1.0"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project default="jar:jar" xmlns:j="jelly:core" xmlns:maven="jelly:maven">
<!-- Adds the jdbc-stdext to the dependency classpath if the
dependency.jdbc property is defined.
-->
<preGoal name="java:compile">
<j:if test="${dependency.jdbc != ''}">
<path id="extended.dependency.path">
<pathelement path="${dependency.jdbc}"/>
</path>
<maven:addPath id="maven.dependency.classpath" refid="extended.dependency.path"/>
</j:if>
</preGoal>
<!-- Ensures that the conf directory and NOTICE.txt are included in the
source distro.
-->
<postGoal name="dist:prepare-src-filesystem">
<mkdir dir="${maven.dist.src.assembly.dir}/conf"/>
<copy todir="${maven.dist.src.assembly.dir}/conf">
<fileset dir="${basedir}/conf">
</fileset>
</copy>
<copy todir="${maven.dist.src.assembly.dir}">
<fileset file="${basedir}/NOTICE.txt"/>
<fileset file="${basedir}/RELEASE-NOTES.txt"/>
<fileset file="${basedir}/default.properties"/>
<fileset file="${basedir}/pom.xml"/>
</copy>
<mkdir dir="${maven.dist.src.assembly.dir}/xdocs"/>
<copy todir="${maven.dist.src.assembly.dir}/xdocs">
<fileset dir="${basedir}/xdocs">
</fileset>
</copy>
</postGoal>
<!-- Ensures that NOTICE.txt is added to the binary distro -->
<preGoal name="dist:build-bin">
<copy todir="${maven.dist.bin.assembly.dir}">
<fileset file="${basedir}/NOTICE.txt"/>
<fileset file="${basedir}/RELEASE-NOTES.txt"/>
</copy>
<!-- Create a jar file containing the sources -->
<jar destfile="${maven.dist.bin.assembly.dir}/${maven.final.name}-sources.jar">
<zipfileset prefix="META-INF" dir="${basedir}"
includes="LICENSE*, NOTICE*"/>
<fileset dir="${basedir}/src/java" includes="**/*.java"/>
</jar>
<!-- Create a jar file containing the Javadocs -->
<jar destfile="${maven.dist.bin.assembly.dir}/${maven.final.name}-javadoc.jar">
<zipfileset prefix="META-INF" dir="${basedir}"
includes="LICENSE*, NOTICE*"/>
<fileset dir="${basedir}/target/docs/apidocs"/>
</jar>
</preGoal>
<!-- NonStringTestHolder.java contains tests shared by JUnit and Cactus
tests. This ugly hack moves the src from /src/test to /src/test-cactus
so the Cactus tests will compile. Not sure what is worse, this hack, or
just duplicating the code!
-->
<preGoal name="cactus:compile">
<copy todir="${basedir}/src/test-cactus/org/apache/commons/configuration">
<fileset dir="${basedir}/src/test/" includes="**/NonStringTestHolder.java"/>
</copy>
</preGoal>
<!-- Remove the files generated previously by JavaCC -->
<preGoal name="javacc">
<delete>
<fileset dir="src/java/org/apache/commons/configuration/plist">
<include name="PropertyListParser*.*"/>
<include name="Token.java"/>
<include name="TokenMgrError.java"/>
<include name="SimpleCharStream.java"/>
<include name="ParseException.java"/>
<exclude name="*.jj"/>
</fileset>
</delete>
</preGoal>
<!-- Move the files generated by JavaCC to the source directory -->
<postGoal name="javacc">
<move todir="${basedir}/src/java/org/apache/commons/configuration/plist">
<fileset dir="target/generated-src/main/java/org/apache/commons/configuration"/>
</move>
</postGoal>
</project>