blob: f1d90ea781aa8572c20bd73f6a151d91d9b6ea7c [file] [log] [blame]
<!--
Copyright 2001-2004 The Apache Software Foundation.
Licensed 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">
<!-- ==================================================================
- COMMONS-BUILD TWEAKS
-
- Ensure commons-build stylesheets are copied into target directory
- when executing the xdoc goal (part of the site goal), so that the
- resulting website has the correct look-and-feel.
-
- This goal assumes that commons-build is checked out as a sibling
- to the directory we are doing the build in.
-
- Copy the release notes into the target directory, so that they
- are available on the website.
================================================================== -->
<postGoal name="xdoc:copy-resources">
<copy todir="${basedir}/target/docs/style/" failonerror="false">
<fileset dir="${basedir}/../commons-build/xdocs/style">
<include name='**/*'/>
</fileset>
</copy>
<copy todir="${basedir}/target/docs/" failonerror="false">
<fileset dir="${basedir}">
<include name='RELEASE-NOTES.txt'/>
</fileset>
</copy>
</postGoal>
<!-- ==================================================================
- JAR tweaks
-
- Unit test tweaks
================================================================== -->
<preGoal name="test:test">
<echo level="warning">
Unit testing cannot be done in Maven; the tests require classpaths and
system properties to be set differently for different unit tests which
Maven does not support. Please run "ant test" to execute the unit tests.
</echo>
</preGoal>
<!-- ==================================================================
- JAR tweaks
-
- Maven is designed to create only one jar file ("artifact") for each
- project.xml file. However we want to create a couple of additional
- jars that contain subsets of the main "commons-digester.jar" file.
- So here we arrange for those jars to be created.
-
- We unpack the main jar into a temp dir, then create a new jar file
- including or excluding the relevant files. This is simpler than
- trying to recreate an appropriate MANIFEST.MF file.
================================================================== -->
<postGoal name="jar:jar">
<j:set var="logging.api.work.dir">${maven.build.dir}/logging-api-work</j:set>
<delete dir="${logging.api.work.dir}"/>
<mkdir dir="${logging.api.work.dir}"/>
<unzip
src="${maven.build.dir}/${maven.final.name}.jar"
dest="${logging.api.work.dir}"/>
<delete file="${maven.build.dir}/${maven.final.name}-api.jar"/>
<zip destfile="${maven.build.dir}/${maven.final.name}-api.jar"
index="${maven.jar.index}"
compress="${maven.jar.compress}">
<fileset dir="${logging.api.work.dir}">
<exclude name="**/AvalonLogger.class"/>
<exclude name="**/Jdk13LumberjackLogger.class"/>
<exclude name="**/Log4jFactory.class"/>
<exclude name="**/Log4JLogger.class"/>
<exclude name="**/LogKitLogger.class"/>
</fileset>
</zip>
<delete file="${maven.build.dir}/${maven.final.name}-adapters.jar"/>
<zip destfile="${maven.build.dir}/${maven.final.name}-adapters.jar"
index="${maven.jar.index}"
compress="${maven.jar.compress}">
<fileset dir="${logging.api.work.dir}">
<include name="**/impl/**.class"/>
</fileset>
</zip>
</postGoal>
</project>