blob: eccf75b40c8f93383d4c1d516016a855c37136ac [file] [log] [blame]
<!--
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:ant="jelly:ant" xmlns:j="jelly:core">
<!-- we can customize the Maven build here -->
<!-- Set up the test files -->
<postGoal name="test:test-resources">
<copy todir="${test.basedir}/read-tests">
<fileset dir="${test.data.src}/basedir"/>
</copy>
<copy todir="${test.basedir}/">
<fileset dir="${test.data.src}" includes="nested.*,test.*"/>
</copy>
<!-- Compile the code for the class loader test -->
<javac
destdir="${test.basedir}"
debug="${maven.compile.debug}"
deprecation="${maven.compile.deprecation}"
optimize="${maven.compile.optimize}">
<src>
<path>
<pathelement location="${test.data.src}"/>
</path>
</src>
</javac>
<mkdir dir="${test.basedir}/read-tests/emptydir"/>
<!-- Create a zip file - its not possible to create tgz, tar and tbz2 so we provide
the whole set for download now
<zip zipfile="${test.basedir}/test.zip">
<zipfileset dir="${test.basedir}">
<include name="read-tests/**"/>
<include name="code/**"/>
</zipfileset>
</zip>
<zip zipfile="${test.basedir}/nested.zip">
<zipfileset dir="${test.basedir}">
<include name="test.zip"/>
</zipfileset>
</zip>
<jar
jarfile="${test.basedir}/test.jar"
manifest="${test.data.src}/test.mf">
<fileset dir="${test.basedir}">
<include name="read-tests/**"/>
<include name="code/**"/>
</fileset>
</jar>
<jar
jarfile="${test.basedir}/nested.jar"
basedir="${test.basedir}"
includes="test.jar"/>
-->
</postGoal>
<preGoal name="dist:build-bin">
<copy todir="${maven.dist.bin.assembly.dir}">
<fileset file='${basedir}/RELEASE_NOTES.txt'/>
<fileset file='${basedir}/NOTICE.txt'/>
</copy>
</preGoal>
<preGoal name="dist:build-src">
<copy todir="${maven.dist.src.assembly.dir}">
<fileset file='${basedir}/RELEASE_NOTES.txt'/>
<fileset file='${basedir}/NOTICE.txt'/>
</copy>
<!-- Copy Source -->
<copy todir="${maven.dist.src.assembly.dir}/core">
<fileset dir='${basedir}/core'>
<include name="**/*.java" />
<include name="**/*.xml" />
<include name="**/*.properties" />
<include name="**/*.html" />
<include name="src/test/test-data/**" />
<exclude name="target/**" />
</fileset>
</copy>
<copy todir="${maven.dist.src.assembly.dir}/examples">
<fileset dir='${basedir}/examples'>
<include name="**/*.java" />
<include name="**/*.xml" />
<include name="**/*.properties" />
<include name="**/*.html" />
<exclude name="target/**" />
</fileset>
</copy>
<!-- Copy XDocs -->
<copy todir="${maven.dist.src.assembly.dir}/xdocs">
<fileset dir='${basedir}/xdocs'/>
</copy>
</preGoal>
<!-- ================================================================== -->
<!-- Create MD5 Check Sums -->
<!-- ================================================================== -->
<postGoal name="dist">
<!-- create checksum for jar -->
<ant:checksum file="${maven.build.dir}/${maven.final.name}.jar" property="jar.md5"/>
<ant:echo message="${jar.md5} *${maven.final.name}.jar"
file="${maven.build.dir}/${maven.final.name}.jar.md5"/>
<!-- create checksum for binary zip -->
<ant:checksum file="${maven.dist.dir}/${maven.final.name}.zip" property="zip.md5"/>
<ant:echo message="${zip.md5} *${maven.final.name}.zip"
file="${maven.dist.dir}/${maven.final.name}.zip.md5"/>
<!-- create checksum for binary tar.gz -->
<ant:checksum file="${maven.dist.dir}/${maven.final.name}.tar.gz" property="tar.gz.md5"/>
<ant:echo message="${tar.gz.md5} *${maven.final.name}.tar.gz"
file="${maven.dist.dir}/${maven.final.name}.tar.gz.md5"/>
<!-- create checksum for source zip -->
<ant:checksum file="${maven.dist.dir}/${maven.final.name}-src.zip" property="src.zip.md5"/>
<ant:echo message="${src.zip.md5} *${maven.final.name}-src.zip"
file="${maven.dist.dir}/${maven.final.name}-src.zip.md5"/>
<!-- create checksum for source tar.gz -->
<ant:checksum file="${maven.dist.dir}/${maven.final.name}-src.tar.gz" property="src.tar.gz.md5"/>
<ant:echo message="${src.tar.gz.md5} *${maven.final.name}-src.tar.gz"
file="${maven.dist.dir}/${maven.final.name}-src.tar.gz.md5"/>
</postGoal>
</project>