ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ray Tayek <>
Subject jar task is really nice with local build, but how do i ...
Date Sat, 29 Mar 2003 08:20:01 GMT
hi, i noticed an interesting thing when using a local build file (see blow) 
or this simple project (it screen scrapes go games from 
and converts them in to .sgf files so i can fool around with them easier).

what i noticed was that the jar had *all* of the "other" files i needed 
from the source tree (like my io.* and gnu.getopt) even though my class 
files were put into ./classes (i.e. the com.tayek.... class tree was built 

i have this other jar task src (see below) that jars up the source from 
where i am but it has no way of knowing that i need* and 

is there any way for ant to do this? (i.e. jar up all of the source that i 
need to run the build file without having to explicitly include them a line 
at a time). so i could take this file and install it somewhere else 
(ignoring for the moment any additional jars that it needed to run).


<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="all" name="pgn2sgf">
         <property name="src.root" value="../../../../.."/>
     <target name="init">
     <target name="compile" depends="init">
                 <mkdir dir="classes"/>
         <javac srcdir="${src.root}" destdir="classes" debug="true" 
             <include name="com/tayek/games/go/pgn2sgf/**.java"/>
             <exclude name="com/tayekgames/go/pgn2sgf/**/test/**/*.java"/>
                 <copy file="" 
     <target name="jar" depends="init,compile">
                 <mkdir dir="lib"/>
         <jar manifest="" jarfile="lib/pgn2sgf.jar" 
compress="true" basedir="classes">
             <exclude name="**/deleted/**"/>
     <target name="src" depends="init,compile">
                 <mkdir dir="lib"/>
         <jar jarfile="lib/pgn2sgfsrc.jar" compress="true" 
             <include name="com/tayek/games/go/pgn2sgf/**.java"/>
             <exclude name="com/tayek/games/go/pgn2sgf/**/test/**/*.java"/>
             <include name="com/tayek/games/go/pgn2sgf/**.xml"/>
             <include name="com/tayek//games/gopgn2sgf/**.bat"/>
             <include name="com/tayek/games/go/pgn2sgf/**/"/>
             <exclude name="**/deleted/**"/>
     <target name="all" depends="init,jar,src" description="Build everything.">
     <target name="run" depends="compile" description="run from classes/.">
         <java classname="" fork="true" 
                 <pathelement location="classes"/>
             <arg line="-f"/>
             <arg line="-u"/>
     <target name="run2" depends="jar" description="run from the jar">
         <java fork="true" jar="lib/pgn2sgf.jar">
             <arg line="-f"/>
             <arg line="-u"/>
                         <arg line="-c 15200000937211O378560l0"/>
             <arg line="-d d:/usr/lec/ray"/>
     <target name="run2lec" depends="jar" description="run lecs from the jar">
         <java fork="true" jar="lib/pgn2sgf.jar">
             <arg line="-f"/>
             <arg line="-u"/>
                         <arg line="-c 15200000433079O662400l0"/>
             <arg line="-d d:/usr/lec/lec"/>
         <target name="clean" depends="init" description="Clean all build 
                 <delete dir="classes"/>
                 <delete dir="lib"/>

ray tayek actively seeking mentoring or telecommuting work
vice chair orange county java users group
hate spam?

View raw message