Mega Code Archive

 
Categories / Java / Ant
 

Jar file with fileset and exclude

<?xml version="1.0"?> <!--  -  build.xml file for LBS logics aMorph build process (for Ant Version 1.6)  -  -  (c) LBS logics MBT GmbH,  -      Austria  -      www.lbs-logics.com  -  - $Id: build.xml,v 1.1 2005/01/18 07:26:05 hanzz Exp $  --> <!-- /* This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */ --> <project name="amorph"  default="build"  basedir=".">   <!-- PH20050118: introduced ant build script, targets to come... -->      <!-- The classpath to be used to compile the project -->   <path id="base.classpath">     <fileset dir="lib">       <include name="**/*.jar"/>     </fileset>   </path>      <target name="init">     <mkdir dir="build" />     <mkdir dir="build/classes"/>   </target>      <target name="compile">     <javac srcdir="src" destdir="build/classes">       <classpath refid="base.classpath" />     </javac>   </target>      <target name="build" description="compiles and packs the project" depends="init,compile">     <jar destfile="build/amorph.jar"            basedir="build/classes"  >       <fileset dir=".">         <exclude name="build/**/*.*"/>         <exclude name=".classpath"/>         <exclude name=".project"/>         <exclude name="bin/**/*.*"/>       </fileset>     </jar>     </target> </project>