| jar task is really nice with local build, but how do i ... | jar task is really nice with local build, but how do i ... 2003-03-29 - By Ray Tayek
hi, i noticed an interesting thing when using a local build file (see blow) or this simple project (it screen scrapes go games from www.itsyourturn.com 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 here).
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 com.tayek.io.* and gnu.getopt.
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).
thanks
<?xml version="1.0" encoding="UTF-8"?> <project basedir="." default="all" name="pgn2sgf"> <property name="src.root" value="../../../../.."/> <target name="init"> </target> <target name="compile" depends="init"> <mkdir dir="classes"/> <javac srcdir="${src.root}" destdir="classes" debug="true" deprecation="true"> <include name="com/tayek/games/go/pgn2sgf/**.java"/> <exclude name="com/tayekgames/go/pgn2sgf/**/test/**/*.java"/> </javac> <copy file="MessagesBundle.properties" todir="classes/gnu/getopt"/> </target> <target name="jar" depends="init,compile"> <mkdir dir="lib"/> <jar manifest="manifest.mf" jarfile="lib/pgn2sgf.jar" compress="true" basedir="classes"> <exclude name="**/deleted/**"/> </jar> </target> <target name="src" depends="init,compile"> <mkdir dir="lib"/> <jar jarfile="lib/pgn2sgfsrc.jar" compress="true" basedir="${src.root}"> <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/**/manifest.mf"/> <exclude name="**/deleted/**"/> </jar> </target> <target name="all" depends="init,jar,src" description="Build everything."> </target> <target name="run" depends="compile" description="run from classes/."> <java classname="com.tayek.games.go.pgn2sgf.Pgn2Sgf" fork="true" failonerror="true"> <classpath> <pathelement location="classes"/> </classpath> <arg line="-f"/> <arg line="-u"/> </java> </target> <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"/> </java> </target> <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"/> </java> </target> <target name="clean" depends="init" description="Clean all build products."> <delete dir="classes"/> <delete dir="lib"/> </target> </project>
--- ray tayek http://tayek.com/ actively seeking mentoring or telecommuting work vice chair orange county java users group http://www.ocjug.org/ hate spam? http://samspade.org/ssw/
|
|
 |