On Tue, 2009-05-26 at 17:16 -0700, Dean Schulze wrote:

Gradle is a plugin-based, convention-based system.  So whilst you can
create tasks which do all the compilation according to manually set up
rules à la Ant (or better still Gant), people generally just use the
conventions and the plugins à la Maven.  So if your Java source is in
src/main/java and you use then java plugin then Gradle will just cause
all the Java source to be compiled.

Convention-based systems win in (almost) all situations.
> 
> Those links are the same material that is in the user guide, which
> I've read twice and still don't have a clue about how to use gradle to
> build a j2ee project.
> 
> I've written many Ant builds, some very complex, but your
> documentation doesn't give me a clue about how to do basic things like
> compile .java files.
> 
> The problem is that chapter 6 is cryptic.  A typical J2EE project has
> source files that get compiled with javac, web artifacts like .html
> and .jsp pages that simply get moved to a directory in the .war
> structure, and deployment descriptors.
> 
> I don't see any of that in your documentation.
> 
> How do I compile my .java files?  How do I specify the src/ and output
> directories?  How do I move artifacts into WEB-INF/lib, etc?
> 
> Ant, for all of its shortcomings is at least intuitive.  The
> attributes and child elements of <javac>, <jar>, and <war> correspond
> to the underlying tools.  Ant falls flat on its face, however, with
> simple things like doing if ... else...  You can't change the value of
> a property, and lots of other things.  That's really what I'm looking
> for from gradle.
> 
> If chapter 6 is the "normal" way to do things in gradle, then you've
> made very straight forward things cryptic.  If I wanted that I'd use
> Maven.
> 

If you don't want the power of a convention-based system, then you can
use the old-fashioned, low-level, manual, explicit Ant way of doing
things (*).  Gradle does support this, but as you say it is not as well
documented as that is not how Gradle is supposed to be used.  The
documentation is there though in the bits that show how tasks are
created and how Ant tasks can be used.

It is possible to transliterate an Ant file to a Gradle file, though it
might just be easier to use Gant -- there is a terminology change
between Ant and Gradle where there is not between Ant and Gant.  Gant is
just an Ant task scripting system in Groovy, Gradle is a full
convention-based build system.

Of course it may be that your build actually does need explicit
low-level stuff, in which apologies for over-stating the case for
convention.  However, I would be surprised.  Hans, Adam, et al. have
been careful to ensure all the common use cases have appropriate
convention-based approaches.

(*) Not too over the top I hope ;-)
-- 
Russel.
============================================================
Dr Russel Winder                 Partner

Concertant LLP          t: +44 20 7585 2200, +44 20 7193 9203
41 Buckmaster Road,     f: +44 8700 516 084    voip:  
sip:[email protected]
London SW11 1EN, UK.    m: +44 7770 465 077    xmpp: [email protected]

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to