You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Garrett Rooney <ro...@rpi.edu> on 2000/06/16 17:57:20 UTC

stupid newbie questions

so in an attempt to free my project from the hell that is make, i'm trying
to get a build system setup using ant.

first problem:  we use jdk1.3, and in the 3.1 release of ant, the
doModernCompile method in Javac.java is empty except for a logging message
that leads you to believe that more is being done than actually is.  as a
stopgap measure, i copied the doClassicCompile method into the
doModernCompile method, and it seems to function.  is there any good
reason not to do this?  in retrospect, i'm assuming this is probably fixed
in the cvs version, but that didn't occur to me at the time.

second problem.  now that i'm able to get ant to compile things, the
srcdir and destdir portions of the <javac/> tag seem to be acting weird.

srcdir is pointing to the root of our development tree (a directory called
rcn), and destdir is pointing to the build directory.  when i run ant, it
places all the compiled classes in build/rcn (rcn is the name of the
project, and the name of the srcdir), and then copies all non .java files
into build.  so the class files end up in a different directory structure
than the other files. 

is there any way to simply have ant compile the .java files in place, and
refrain from copying anything anywhere?  that's how our current makefile
system works, and we're fine with that.

here's the build.xml file i've been playing with...  (you know, i've got
this feeling i'll figure out my stupid mistake as soon as i send this
mail, but oh well)

<project name="rcn" default="compile" basedir=".">

  <property name="src" value="rcn"/>
  <property name="dst" value="build"/>

  <target name="compile">

    <fixcrlf srcdir="${src}"
        includes="*.java"/>
    
    <javac srcdir="${src}"
           destdir="${dst}"
           debug="on"
           deprecation="on"
           optimize="on" >
    </javac>

  </target>

</project>

thanks,

-garrett

x----------------------------------------------------------------------x
| rooneg@rpi.edu                                        garrett rooney |
| http://www.rpi.edu/~rooneg                                 unix geek |
|----------------------------------------------------------------------|
|  unrequited love is neat because it lasts so much longer - w. t. c.  |
x----------------------------------------------------------------------x


Re: stupid newbie questions

Posted by Stefan Bodewig <bo...@bost.de>.
Hi Garret,

>>>>> "GR" == Garrett Rooney <ro...@rpi.edu> writes:

 GR> first problem: we use jdk1.3, and in the 3.1 release of ant, the
 GR> doModernCompile method in Javac.java is empty except

fixed in CVS as you had already thought.

 GR> second problem.  now that i'm able to get ant to compile things,
 GR> the srcdir and destdir portions of the <javac/> tag seem to be
 GR> acting weird.

No, it's the javac task that's acting weird. For "historical reasons"
javac does an implicit copyfile on everything that's not .java . This
is said to change in the future - some projects are known to rely on
it and somehow everybody seems to be waiting to remove this.

If you go to the CVS version, the delete task will take an dir
attribute as well as include/exclude attributes. Place a

<delete dir="${dst}">
  <exclude name="**/*.class" />
</delete>

immediately behind your javac task to get rid of them.

On the other hand you said you wanted the files to be compiled in
place. Forget about the delete task and simply set destdir to ${src}
as well.

HTH

Stefan

Re: Bug or RFE launching Java or Javadoc?

Posted by Patrick Chanezon <ch...@netscape.com>.
Hi Eddie,
The FM is at http://jakarta.apache.org/guidelines/source.html
You can submit a patch in this list as described at this url.

P@

Eddie Sheffield wrote:

> Hi all,
>
> I just started working with Ant this morning. I'm anxious to get rid of the
> horrible mess of makefiles that we currently have, and Ant looks really
> promising!
>
> Anyway, I already have encountered a problem in building Ant itself. Near as
> I can tell, I configured everything as described in the instructions, but
> when I built it bombed on the javadoc statement. I discovered the problem
> was that I didn't have %JAVA_HOME%\bin on my PATH. Since I tend to work with
> a number of different JDKs, I usually don't keep any on my PATH and add them
> manually when necessary. However, it seems it would be nice if there were a
> way in Ant to specify which javadoc (and looking at the source, java) should
> be used for that task. Or perhaps at least pick up the system property
> "java.home" to run the same javadoc/java that is currently being run.
>
> I would be glad to make an attempt at changing this myself, but that leads
> to another question. How do I submit code? I have looked over the docs at
> the web site, and see that only Committers have write access to the
> repository. Do I send changes to a committer to review or to the original
> owner/creator of the file? or something else. Maybe I missed something on
> the web site, but I've gone through all the docs that I found links to. I
> apologize if this is a stupid RTFM thing, but which FM ;-) ?
>
> Thanks,
>
> Eddie Sheffield

--
Patrick Chanezon, iPlanet Market Maker- Portal/EServices Technical Lead
Netscape Communications Corp. - http://people.netscape.com/chanezon/
Opinions are my own.

"Two monks were arguing about a flag. One said: `The flag is moving.'
The other said: `The wind is moving.'
The sixth patriach happened to be passing by. He told them: `Not the wind, not
the flag; mind is moving.'"
Zen Koan


RE: Bug or RFE launching Java or Javadoc?

Posted by Vitaly Stulsky <vi...@yahoo.com>.
Try http://jakarta.apache.org/guidelines/source.html. 
I believe it will help you to make proper patches.

Cheers,
Vitaly



__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com

Re: Bug or RFE launching Java or Javadoc?

Posted by Tom Dimock <ta...@cornell.edu>.
At 01:54 PM 06/16/2000 -0400, you wrote:
>Hi all,
>
>I just started working with Ant this morning. 
...
>I would be glad to make an attempt at changing this myself, but that leads
>to another question. How do I submit code? I have looked over the docs at
>the web site, and see that only Committers have write access to the
>repository. Do I send changes to a committer to review or to the original
>owner/creator of the file? or something else. Maybe I missed something on
>the web site, but I've gone through all the docs that I found links to. I
>apologize if this is a stupid RTFM thing, but which FM ;-) ?

Having fairly recently been where you are, I can identify with your
problem.  The FM you want is
<http://jakarta.apache.org/getinvolved/getinvolvedindex.html>
----------------------------------------------------------------------------
       Tom Dimock  ----  Cornell University  ----  tad1@cornell.edu
"There go my people.  I must follow them, for I am their leader."  M. Gandhi

Bug or RFE launching Java or Javadoc?

Posted by Eddie Sheffield <ed...@inline-software.com>.
Hi all,

I just started working with Ant this morning. I'm anxious to get rid of the
horrible mess of makefiles that we currently have, and Ant looks really
promising!

Anyway, I already have encountered a problem in building Ant itself. Near as
I can tell, I configured everything as described in the instructions, but
when I built it bombed on the javadoc statement. I discovered the problem
was that I didn't have %JAVA_HOME%\bin on my PATH. Since I tend to work with
a number of different JDKs, I usually don't keep any on my PATH and add them
manually when necessary. However, it seems it would be nice if there were a
way in Ant to specify which javadoc (and looking at the source, java) should
be used for that task. Or perhaps at least pick up the system property
"java.home" to run the same javadoc/java that is currently being run.

I would be glad to make an attempt at changing this myself, but that leads
to another question. How do I submit code? I have looked over the docs at
the web site, and see that only Committers have write access to the
repository. Do I send changes to a committer to review or to the original
owner/creator of the file? or something else. Maybe I missed something on
the web site, but I've gone through all the docs that I found links to. I
apologize if this is a stupid RTFM thing, but which FM ;-) ?

Thanks,

Eddie Sheffield



Would you call this a bug?

Posted by Chris Miller <ki...@vardus.co.uk>.
Something that I got stung by the other day led to the creation of a 400MB+
file (and growing!) before I realised what was going on and intervened...

I had something like the following in my build.xml file:

<jar jarfile="build_dir/project-src.jar" basedir="."/>

Simple enough, just packing up all the source code etc for my project.
Unfortunately I forgot to exclude the build_dir itself from the jar
operation. This lead to an attempt to add the jar file to itself, thus
creating an infinitely large file...
I'm not sure if it is just something that people should watch out for, or if
ant should check for this situation? Any comments?


RE: stupid newbie questions

Posted by Garrett Rooney <ro...@rpi.edu>.
On Fri, 16 Jun 2000, Vitaly Stulsky wrote:

> your srcdir must be "src". In your case I think your sources have rcn as first
> package name.

thanks, that solved the problem.

-garrett

x----------------------------------------------------------------------x
| rooneg@rpi.edu                                        garrett rooney |
| http://www.rpi.edu/~rooneg                                 unix geek |
|----------------------------------------------------------------------|
|  unrequited love is neat because it lasts so much longer - w. t. c.  |
x----------------------------------------------------------------------x


RE: stupid newbie questions

Posted by Vitaly Stulsky <vi...@yahoo.com>.
First problem was solved by patch. You have to get fresh version of 
ant sources and build it.
Second one AFAIK, could arise while your srcdir points under directory
which corresponds to the first package name. Your srcdir has to point to
directory, where your root package resides. If you have package structure like that:
com.company.blablabla
and directory with sources:
src
  com
    company
      blablabla
your srcdir must be "src". In your case I think your sources have rcn as first
package name.

Vitaly


__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com