ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pgo...@ccis.com
Subject Re: Using recursive processing.
Date Wed, 25 Jul 2001 13:13:32 GMT
>On Wed, 25 Jul 2001, <pgonia@ccis.com> wrote:
>
>>     <jar jarfile="${project_jar}/TCPStat.jar">
>>         <fileset dir="${classes_output}/gov/nasa/dfrc/MeasUNet/**"/>
>>     </jar>
>> 
>> I basicaly wish to jar of of the currents project .class files
>> (located in gov/nasa/dfrc/MeasUNet directory structure).
>
>That would be
>
>    <jar jarfile="${project_jar}/TCPStat.jar">
>        <fileset dir="${classes_output}/gov/nasa/dfrc/MeasUNet"
>                 includes="**/*.class" />
>    </jar>
>
>Assuming classes_output points to the correct parent directory.
>
>> The rube is that the are several other packets included in the
>> gov.nasa.dfrc package prefix. However, I wish only to compile, and
>> jar up those .java source files related to the current project.
>
>So use the excludes attribute or nested exclude elements - to exclude
>packages rincewind and twoflower:
>
>        <fileset dir="${classes_output}/gov/nasa/dfrc/MeasUNet">
>           <include name="**/*.class" />
>           <exclude name="**/rincewind/**" />
>           <exclude name="**/twoflower/**" />
>        </fileset>

Thanks for the help everyone.

However, I am still having problems. The build completes and states that it
was successful. However, the jar file is unusable. The jar -tvf <build.jar>
exposes the following:

tar: 22 garbage bytes ignored at end of archive
tar: Error exit delayed from previous errors


Ant debug provides the following info:

init:
Setting project property: DSTAMP -> 20010725
Setting project property: TSTAMP -> 0650
Setting project property: TODAY -> July 25 2001
 
compile_source:
    [javac] gov/nasa/dfrc/MeasUNet/plugins/tcpstat/TCPStat.java added as /home/dev/development/projects/gov/nasa/dfrc/MeasUNet/plugins/tcpstat/TCPStat.class
doesn't exist.
    [javac] Compiling 1 source file to /home/dev/development/projects
    [javac] Using modern compiler
    [javac] Compilation args: -d /home/dev/development/projects -classpath /home/dev/development/projects:/usr/share/java/ant.jar:/usr/share/java/jaxp.jar:/usr/share/java/optional.jar:/usr/share/java/parser.jar:/opt/IBMJava2-13/lib/tools.jar:/opt/IBMJava2-13/jre/lib/rt.jar
-sourcepath /home/dev/development/sources
    [javac] File to be compiled:
    /home/dev/development/sources/gov/nasa/dfrc/MeasUNet/plugins/tcpstat/TCPStat.java

 
 
done:
      [jar] Note: creating empty jar archive /home/dev/development/jars/TCPStat.jar

 
BUILD SUCCESSFUL
 
Total time: 2 seconds

Below is the build file I am using:

<project name="TCPStat" default="done" basedir="/home/dev/development">

<!-- set global properties for this build -->
<property name="java_source" value="${basedir}/sources"/>
<property name="classes_output" value="${basedir}/projects"/>
<property name="jars" value="${basedir}/jars"/>

<target name="init">
    <!-- Create the time stamp -->
    <tstamp/>
</target>

<target name="compile_source" depends="init">
    <!-- Compile the java code for this project -->
    <javac destdir="${classes_output}">
        <src path="${java_source}"/>
        <include name="**/*.java"/>
        <exclude name="**/CVROOT/**"/>
        <exclude name="**/aeroSapient/**"/>
        <exclude name="**/benchMark/**"/>
        <exclude name="**/exceptions/**"/>
        <exclude name="**/junk/**"/>
        <exclude name="**/sml/**"/>
        <exclude name="**/spdp/**"/>
        <exclude name="**/utility/**"/>
    </javac>
</target>

<target name="done" depends="compile_source">
    <!-- JAR the compiled code into TCPStat.jar -->
    <jar jarfile="${jars}/TCPStat.jar">
        <fileset dir="${classes_output}">
           <include name="**/.class"/>
           <exclude name="**/CVROOT/**"/>
           <exclude name="**/aeroSapient/**"/>
           <exclude name="**/benchMark/**"/>
           <exclude name="**/exceptions/**"/>
           <exclude name="**/junk/**"/>
           <exclude name="**/sml/**"/>
           <exclude name="**/spdp/**"/>
           <exclude name="**/utility/**"/>
        </fileset>
    </jar>
</target>

</project>


I have reviewed the Ant users manual and have found it to be a great resource.
However I have been working on setting up a build file (Ant) all day now and
have decided that I'm to close to the problem. 

The Ant debug output has been very helpful in getting this build file to even
compile the project. And has the output shows the jar utility seems to be running
but with the indicated problem.

The Ant debug output doesn't really provide much of any help in the area of
jarring up the project.

Anyone interested in helping?

PTG




Mime
View raw message