ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antoine Levy-Lambert" <anto...@antbuild.com>
Subject Re: just not getting it
Date Sun, 10 Aug 2003 21:01:41 GMT

----- Original Message -----
From: "Gregory Seidman" <gss+ant@cs.brown.edu>
To: "Ant users mailing list" <user@ant.apache.org>
Sent: Sunday, August 10, 2003 10:44 PM
Subject: just not getting it


> I'm trying to understand the basic concept of Ant, and I'm just not
getting
> it. Until I understand how to get Ant to compile a bunch of Java source
> files and pack them all into a jar file with the correct main class in its
> META-INF, it won't help me to understand how to add external tasks. I
don't
> even understand the meaning of task.
>

Don't worry.
A task is an action, like compiling java source code (<javac/>) or building
a jar file (<jar/>) or defining a property (<property/>)
Tasks are implemented in ant as Java classes, and they are used by build
file writers when they put the corresponding xml tags such as <jar/> or
<javac/>

To find out how to compile a bunch of java source code and pack them into a
jar file, you can :

- have a look at examples : for instance, if you download ant's source
distribution, in the root directory there is the file "build.xml" which is
used to compile ant and to run the Junit tests on it. In ant's own line
manual (part of each distribution, and also visible under
http://ant.apache.org/manual) there are examples of the use of each tasks.
In the document titled "using ant"
http://ant.apache.org/manual/using.html#example , there is also a sample
build file which you can use.

- to find out how to make your jar file have a start class, have a look at
the documentation of the jar task and/or of the manifest task.

Cheers,

Antoine





> I'm sure that part of the problem is that I am looking at this through
> make-colored glasses. I've been using make for a decade or more, and
> created a pretty serious build system with it (for a graduate project and,
> later, a project at work). I've been working with Java since 1995. I'm not
> a newbie to software development, and I've read throug the ant FAQ and
> manual, yet some crucial concept is eluding me.
>
> Would someone please explain how to handle the simple example of a
> directory/package tree full of .java source files to be built into a JAR?
> Once I have that toehold, I think I can start learning the rest.
>
> --Greg
>
>
> ---------------------------------------------------------------------
> 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