| <?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. |
| --> |
| |
| <!-- $Id$ --> |
| |
| <project name="lenya-dist"> |
| |
| <description> |
| Distribution Targets |
| </description> |
| |
| <target name="dist" depends="clean,dist-src,dist-bin" description="Build all distribution relevant tarballs"/> |
| |
| <!-- |
| This target prepares the binary distribution tarball for |
| end users. It forces a complete rebuild of everything through its |
| dependency on the "clean" target in order to prevent garbage |
| like the cocoon logfiles from ending up in the distribution tarball. |
| --> |
| <target name="prepare-dist-bin" depends="clean,kupu,war"> |
| |
| <copy todir="${dist.bin.dir}"> |
| <fileset dir="${basedir}"> |
| <include name="INSTALL-BIN.txt"/> |
| <include name="README.txt"/> |
| <include name="LICENSE.txt"/> |
| <include name="NOTICE.txt"/> |
| <include name="CREDITS.txt"/> |
| <include name="lenya.sh"/> |
| <include name="lenya.bat"/> |
| <include name="legal/**"/> |
| </fileset> |
| </copy> |
| |
| <!-- Copy Jetty --> |
| <copy todir="${dist.bin.dir}/tools"> |
| <fileset dir="tools"/> |
| </copy> |
| <delete dir="${dist.bin.dir}/tools/anttasks"/> |
| |
| <!-- Make shell scripts executable --> |
| <chmod file="${dist.bin.dir}/*.sh" perm="ugo+rx"/> |
| <chmod file="${dist.bin.dir}/tools/bin/*.sh" perm="ugo+rx"/> |
| |
| <!-- Make sure linefeeds in shell scripts are UNIX-style --> |
| <fixcrlf srcdir="${dist.bin.dir}" eol="lf" includes="*.sh"/> |
| <fixcrlf srcdir="${dist.bin.dir}/tools/bin" eol="lf" includes="*.sh"/> |
| |
| <!-- Make sure linefeeds in batch files are Windows-style --> |
| <fixcrlf srcdir="${dist.bin.dir}" eol="crlf" includes="*.bat"/> |
| <fixcrlf srcdir="${dist.bin.dir}/tools/bin" eol="crlf" includes="*.bat"/> |
| </target> |
| |
| <target name="dist-bin" depends="prepare-dist-bin" description="Build a regular binary distribution tar ball"> |
| |
| <tar tarfile="${dist.bin.dir}.tar" basedir="${dist.root}" includes="${distname}-bin/**"/> |
| |
| <gzip zipfile="${dist.bin.dir}.tar.gz" src="${dist.bin.dir}.tar"/> |
| <delete file="${dist.bin.dir}.tar"/> |
| <checksum file="${dist.bin.dir}.tar.gz" fileext=".md5"/> |
| |
| <zip zipfile="${dist.bin.dir}.zip" basedir="${dist.root}" includes="${distname}-bin/**"/> |
| <checksum file="${dist.bin.dir}.zip" fileext=".md5"/> |
| </target> |
| |
| <!-- |
| This target prepares the binary distribution tarball for |
| end users. It forces a complete rebuild of everything through its |
| dependency on the "clean" target in order to prevent garbage |
| like the cocoon logfiles from ending up in the distribution tarball. |
| --> |
| <target name="snapshot-bin" depends="prepare-dist-bin" description="Build a snapshot binary distribution tar ball (the same as 'dist' except for the filename)"> |
| <copy todir="${snapshot.bin.dir}"> |
| <fileset dir="${dist.root}/${distname}-bin"/> |
| </copy> |
| |
| <tar tarfile="${snapshot.bin.dir}.tar" basedir="${dist.root}" includes="${snapshot.bin.name}/**"/> |
| |
| <gzip zipfile="${snapshot.bin.dir}.tar.gz" src="${snapshot.bin.dir}.tar"/> |
| <delete file="${snapshot.bin.dir}.tar"/> |
| <zip zipfile="${snapshot.bin.dir}.zip" basedir="${dist.root}/${snapshot.bin.name}"/> |
| </target> |
| |
| <!-- |
| The dist-src target prepares the source distribution tarball for |
| developers. It also depends on the clean target to remove all build stuff. |
| --> |
| <target name="prepare-dist-src" depends="clean"> |
| <mkdir dir="${dist.src.dir}"/> |
| |
| <copy todir="${dist.src.dir}"> |
| <fileset dir="."> |
| <exclude name="local.build.properties"/> |
| <exclude name=".classpath"/> |
| <exclude name=".project"/> |
| <exclude name=".fbprefs"/> |
| <exclude name="dist/**"/> |
| <exclude name="build/**"/> |
| <exclude name="bin/**"/> |
| </fileset> |
| </copy> |
| |
| <!-- Replace version placeholder with build version --> |
| <replace dir="${dist.src.dir}"> |
| <include name="**/welcome.xml"/> |
| <include name="**/about.xml"/> |
| <include name="**/config/publication.xconf"/> |
| <replacefilter token="@lenya.version@" value="${version}"/> |
| <replacefilter token="@lenya.revision@" value="${lenya.revision}"/> |
| </replace> |
| |
| <!-- Make shell scripts executable --> |
| <chmod file="${dist.src.dir}/*.sh" perm="ugo+rx"/> |
| <chmod file="${dist.src.dir}/tools/bin/*.sh" perm="ugo+rx"/> |
| <chmod file="${dist.src.dir}/src/webapp/lenya/bin/*.sh" perm="ugo+rx"/> |
| <chmod file="${dist.src.dir}/src/webapp/lenya/bin/replication/*.sh" perm="ugo+rx"/> |
| |
| <!-- Make sure linefeeds in shell scripts are UNIX-style --> |
| <fixcrlf srcdir="${dist.src.dir}" eol="lf" includes="*.sh"/> |
| <fixcrlf srcdir="${dist.src.dir}/tools/bin" eol="lf" includes="*.sh"/> |
| <fixcrlf srcdir="${dist.src.dir}/src/webapp/lenya/bin" eol="lf" includes="*.sh"/> |
| |
| <!-- Make sure linefeeds in batch files are Windows-style --> |
| <fixcrlf srcdir="${dist.src.dir}" eol="crlf" includes="*.bat"/> |
| <fixcrlf srcdir="${dist.src.dir}/tools/bin" eol="crlf" includes="*.bat"/> |
| </target> |
| |
| <target name="dist-src" depends="prepare-dist-src" description="Builds a regular tar ball containing the sources for developers"> |
| <tar tarfile="${dist.src.dir}.tar" basedir="${dist.root}" includes="${distname}-src/**"/> |
| |
| <gzip zipfile="${dist.src.dir}.tar.gz" src="${dist.src.dir}.tar"/> |
| <delete file="${dist.src.dir}.tar"/> |
| <checksum file="${dist.src.dir}.tar.gz" fileext=".md5"/> |
| |
| <zip zipfile="${dist.src.dir}.zip" basedir="${dist.root}" includes="${distname}-src/**"/> |
| <checksum file="${dist.src.dir}.zip" fileext=".md5"/> |
| </target> |
| |
| <!-- |
| This target prepares the source distribution tarball for |
| end users. It forces a complete rebuild of everything through its |
| dependency on the "clean" target in order to prevent garbage |
| like the cocoon logfiles from ending up in the distribution tarball. |
| --> |
| <target name="snapshot-src" depends="prepare-dist-src" description="Builds a snapshot tar ball containing the sources for developers (the same as 'dist-src' except for the filename)"> |
| <copy todir="${snapshot.src.dir}"> |
| <fileset dir="${dist.src.dir}"/> |
| </copy> |
| |
| <tar tarfile="${snapshot.src.dir}.tar" basedir="${dist.root}" includes="${snapshot.src.name}/**"/> |
| <gzip zipfile="${snapshot.src.dir}.tar.gz" src="${snapshot.src.dir}.tar"/> |
| <delete file="${snapshot.src.dir}.tar"/> |
| </target> |
| |
| <target name="zip-webapp" depends="init" description="Zips the webapp in order to deploy within another servlet container"> |
| <tar tarfile="./${build.dir}/${snapshot.bin.name}.tar" basedir="${build.webapp}"/> |
| <gzip zipfile="./${build.dir}/${snapshot.bin.name}.tar.gz" src="./${build.dir}/${snapshot.bin.name}.tar"/> |
| <delete file="./${build.dir}/${snapshot.bin.name}.tar"/> |
| </target> |
| </project> |