ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vilya Harvey <vilya.har...@digitalsteps.com>
Subject Re: *.java to *.class?
Date Wed, 02 Apr 2003 16:16:13 GMT
Be careful when doing that though: if you have any inner classes, 
anonymous classes, or even if you have any more than one top level class 
in a file anywhere in your code, the additional classes will not be 
picked up. The usual way to do this sort of thing is to specify an 
output directory for the compilation and simply jar up every class file 
in that directory. For example:

    <javac destdir="${classes}" srcdir="${src}" classpathref="myclasspath"/>
    <jar destfile="${jarfile}" basedir="${classes}" includes="**/*.class"/>

Hope that helps,
Vil.

Keith Hatton wrote:

>I think you need the <mapper> element - look in the Ant docs for File Mappers.
>Something like
><mapper type="glob" from="*.java" to="*.class"/>
>
>Hope this helps
>Keith
>
>
>-----Original Message-----
>From: Todor Boev [mailto:t_boev@prosyst.bg]
>Sent: 02 April 2003 16:59
>To: Ant Users List
>Subject: *.java to *.class?
>
>
>Hello all,
>Assume I have a fileset that contains some *.java filles. I need to compile all these
java files and than put into a jar their corresponding *.class files. Is there a way to derive
the list of class files from the list of java files and store it all into a fileset or a property?
>
>
>Best regards,
>Todor Boev
>  
>
--
Vilya Harvey, Consultant
vilya.harvey@digitalsteps.com                 / digital steps /
(W) +44 (0)1483 469 480                                      
(M) +44 (0)7816 678 457                 http://www.digitalsteps.com/

--Disclaimer--

This e-mail and any attachments may be confidential and/or legally
privileged. If you have received this email and you are not a named
addressee, please inform the sender at Digital Steps Ltd by phone on
+44 (0)1483 469 480 or by reply email and then delete the email from
your system. If you are not a named addressee you must not use,
disclose, distribute, copy, print or rely on this email. Although
Digital Steps Ltd routinely screens for viruses, addressees should
check this email and any attachments for viruses. Digital Steps Ltd
makes no representation or warranty as to the absence of viruses in this
email or any attachments.



Mime
View raw message