You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Adam Hardy <ad...@cyberspaceroad.com> on 2002/12/10 16:06:34 UTC

ant for dummies question

I've been using ant for a while with struts and tomcat. Now I'm starting 
an EJB project and am learning more about ant so I can use it here too.

I'm used to having my java classes in the "src" subdirectory. Yet I was 
reading an old post "J2EE config/build best practices" from Drew Davison 
recommending calling the source code dir "java" - which is more common?

Also the struts-originated build.xmls hard-coded the directory name in, 
but wouldn't it be better to have it in the build.properties?

Instead of

<javac srcdir="src"
        destdir="${build.home}/classes"
          debug="${compile.debug}"
    deprecation="${compile.deprecation}"
       optimize="${compile.optimize}">
   <classpath refid="compile.classpath"/>
</javac>

have this:

<javac srcdir="${src}" ....


Thanks for any advice!

Adam


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: ant for dummies question

Posted by Erik Hatcher <ja...@ehatchersolutions.com>.
Adam Hardy wrote:
> I'm used to having my java classes in the "src" subdirectory. Yet I was 
> reading an old post "J2EE config/build best practices" from Drew Davison 
> recommending calling the source code dir "java" - which is more common?

Drew... one of my major mentors in the Java world!

As for naming conventions, its pretty arbitrary, but I see src most often.

> Also the struts-originated build.xmls hard-coded the directory name in, 
> but wouldn't it be better to have it in the build.properties?
> 
> Instead of
> 
> <javac srcdir="src"
>        destdir="${build.home}/classes"
>          debug="${compile.debug}"
>    deprecation="${compile.deprecation}"
>       optimize="${compile.optimize}">
>   <classpath refid="compile.classpath"/>
> </javac>
> 
> have this:
> 
> <javac srcdir="${src}" ....

I disagree with making a property for everything - it just makes things 
too confusing and too indirected unnecessarily.  I hardcode in relative 
paths to my fixed directory structure pieces.  src never moves (relative 
to the project base directory, that is) so its perfectly reasonble to 
hard-code its relative path.

Don't get caught up in the "everything must be a property" mindset - 
only make properties for things that need to be flexible where they are 
written to or read from.

	Erik



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>