ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Harkness, David" <DHarkn...@sonypictures.com>
Subject RE: Newbie using Ant with Eclipse
Date Fri, 11 Jul 2003 18:06:45 GMT
Hiya Bob,

I am definitely using ../ liberally in my build files to include JARs
from other projects into EARs. A few things:

1. I have `` basedir="." '' in my <project> tag.
2. All of my shared JARs are in a lib folder at the same level as my
projects.
   Thus, I use "../lib/*.jar" to get to them.
3. If it helps, here's my JAR task:

        <jar jarfile="${dist.dir}/${identity.service.jar.file}"
             manifest="${meta.dir}/MANIFEST.MF"
             whenempty="fail"
        >
            <!-- Compiled classes -->
            <fileset dir="${class.dir}"/>
            <!-- EJB deployment descriptors -->
            <zipfileset dir="${gen.meta.dir}" prefix="META-INF"/>
            <!-- Optonal log4j properties (blank excludes) -->
            <fileset file="${log4j.properties.file}"/>
        </jar>

Now that I look, all of the included files are in the project directory.
However, here's my EAR task:

        <ear destfile="${dist.dir}/${identity.service.ear.file}"
             appxml="${meta.dir}/application.xml"
             whenempty="fail"
        >
            <!-- Include WebLogic-specific application deployment file
-->
            <metainf file="${meta.dir}/weblogic-application.xml"/>
            <!-- Identity Service JAR -->
            <fileset file="${dist.dir}/${identity.service.jar.file}"/>
            <!-- CDP project dependencies -->
            <fileset file="${serviceAPI.jar}"/>
            <fileset file="${utilities.jar}"/>
            <!-- 3rd-Party utility dependencies -->
            <fileset file="${log4j.jar.file}"/>
            <fileset file="${lib.dir}/${beanutils.jar.file}"/>
            <fileset file="${lib.dir}/${collections.jar.file}"/>
            <fileset file="${lib.dir}/${digester.jar.file}"/>
            <fileset file="${lib.dir}/${logging.jar.file}"/>
            <fileset file="${lib.dir}/${validator.jar.file}"/>
        </ear>

${lib.dir} == "../lib" and the two "CDP project dependencies" JARs are
located in "../lib/cdp1.5".

Have you tried running Ant outside of Eclipse to isolate the problem?
That would be my next step.

Oh, this may have been a typo, but your Alpha JAR task seems incorrect.

> alpha Ant file
> <jar jarfile="bin/alpha.jar" includes="../beta/bin/**/*.class, 
> ../gamma/bin/**/*.properties, **/*.class" basedir="."/>
                                ^^^^^^^^^^

Shouldn't that be "bin/**/*.class"? Of course, if you only have class
files in "bin" it will have the same effect but take a little longer.
I've been using nested filesets rather than includes, but that's just
cuz the template I started with did the same thing. That would be my
next step after determining that it isn't an Eclipse issue, just to be
sure.

Keep plugging away at it -- you'll get it! :)

David Harkness
Sony Pictures Digital Networks
(310) 482-4756


-----Original Message-----
From: Bob Barnes [mailto:gandalf@cal.net] 
Sent: Friday, July 11, 2003 9:13 AM
To: Ant Users List
Subject: Re: Newbie using Ant with Eclipse


David,

    Thanks for the quick reply. As soon as I hit the send button I 
realized the answer to the compression question... happens every time. 
Are you sure about the path semantics accepting ../ style navigation? I 
had already tried that with no luck and I haven't been able to locate 
any reference to that in the online Ant manual. At any rate I can't 
seem to make it work. You understood perfectly my directory structure, 
but just to restate.

I have:

top
top/alpha
top/alpha/bin

top/beta
top/beta/bin

top/gamma
top/gamma/bin

The alpha, beta and gamma directories each contain the Ant build file 
for that project. The Eclipse compile places class files in the bin 
directory. I'm able to access the class files and create the jar for 
each project using something like:

beta Ant file
<jar jarfile="bin/beta.jar" includes="bin/**/*.class" basedir="."/>

but using 'up' navigation like so:

alpha Ant file
<jar jarfile="bin/alpha.jar" includes="../beta/bin/**/*.class, 
../gamma/bin/**/*.properties, **/*.class" basedir="."/>

The beta Ant file correctly builds the beta.jar and the alpha Ant build 
file correctly picks up the class files from the alpha directory, but 
not the beta or gamma directories. I've tried ../, ../../ and even 
../../../ just to make sure I wasn't missing a level. Either I'm doing 
something really stupid (wouldn't be the first time) or there's more to 
it. Just as a side note, what I'd prefer to do is include the jar files 
from beta and gamma into alpha, but I can't get that to work either. 
Any addiional suggestions?

TIA,

Bob


On Thursday, July 10, 2003, at 07:56 PM, Harkness, David wrote:

> If you know that a, b, and c are at the same level (which you stated, 
> but just to make sure), you can access one from the other using normal

> path semantics (".." goes "up" one directory level):
>
>   In a:     ../b/bin
>   In a/bin: ../../b/bin
>
> As for JAR compression:
>
>   http://ant.apache.org/manual/CoreTasks/jar.html
>   compress: Not only store data but also compress them, defaults to
> true
>
> Just use <jar ... Compress="no" ...> to disable it.
>
> David Harkness
> Sony Pictures Digital Networks
> (310) 482-4756
>
>
> -----Original Message-----
> From: Bob Barnes [mailto:gandalf@cal.net]
> Sent: Thursday, July 10, 2003 7:24 PM
> To: user@ant.apache.org
> Subject: Newbie using Ant with Eclipse
>
>
> Hi,
>
>     I'm new to Eclipse and a total neophyte with Ant. I'm trying to 
> use Ant build files to generate jar files as part of my Eclipse 
> project build. I've succeeded in getting most things to build and 
> create proper jar files, but I'm having two problems. First of all I 
> have a directory structure something like:
>
> a/bin
> b/bin
> c/bin
>
>    Each bin directory contains an Ant created jar file. The jar file 
> in a/bin needs to include the jar files built in b/bin and c/bin, but 
> I can't seem to figure out how to reference those directories from a. 
> Is there a way to reference files from one directory to another when 
> the base directories are at the same level?
>
>    Second question is that the jar files are being compressed. As far
> as
>
> I can tell I'm not explicitly requesting compression. Is there a way 
> to create a jar file that uncompressed?
>
> TIA,
>
> Bob
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message