Chapter 15 does look a lot better than Chapter 6.  I don't know why they called 
Chapter 6 a quick start.  It doesn't help you get started at all.

I'm a little worried when you say that you've already spent two days learning 
gradle.  I would expect that with a high level of experience with Java and Ant 
of Maven that someone learning a new build system could be productive with it 
in a couple of hours.  If it takes more than that something is wrong.  Either 
it's too complex or not well documented.

That is why I decided not to use Maven.  It seemed like an exercise in 
unnecessary complexity.

So maybe the first six chapters are a red herring.  I'll take a look at some of 
the other chapters and see if they make more sense.



--- On Tue, 5/26/09, Daniel <[email protected]> wrote:

From: Daniel <[email protected]>
Subject: Re: [gradle-user] Is there an example for migrating a J2EE project  
from Ant to Gradle?
To: [email protected]
Date: Tuesday, May 26, 2009, 6:29 PM

Someone is probably going to respond in more detail, but as a first pointer, 
look at Chapter 15: Java Plugin in combination with Chapter 24: Multiproject 
builds (if you have separate cohesive units that have to be built in isolation 
and might depend on each other).



And you can still use pure ant with

task myTask << {
  ant {
    get(src: 'http://somewhere.com/somefile.txt',
          dest: 'here.txt'


         )
  }
}

I'm still learning (2 days in), but Gradle is pretty amazing and has great 
potential.

Cheers,
Daniel

[1] http://www.gradle.org/0.6/docs/userguide/java_plugin.html


[2] http://www.gradle.org/0.6/docs/userguide/multi_project_builds.html

On Wed, May 27, 2009 at 7:16 AM, Dean Schulze <[email protected]> wrote:





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.




--- On Sat, 5/23/09, Adam Murdoch <[email protected]> wrote:



From: Adam Murdoch <[email protected]>
Subject: Re: [gradle-user] Is there an example for migrating a J2EE project 
from Ant to Gradle?


To: [email protected]
Date: Saturday, May 23, 2009, 12:01 AM




  




Dean Schulze wrote:

  
    
      
        I'd like to start adopting gradle by making a gradle
build to parallel the Ant build*.xml files that I use for my J2EE
projects.

        

I've looked at the user guide and the java examples that come with
gradle, but they're not much help.  The 2 examples aren't remotely like
a typical J2EE project, and the user guide isn't much better.

        

        
      
    
  



The Java multi-project sample is intended to be a typical J2EE project
- it produces a WAR file and a bunch of JAR files. I'm surprised that
you think it isn't remotely like one. How can we improve things to make
this more clear, do you think? What's different to your J2EE project?



There's a walk-through of this sample at
http://www.gradle.org/0.6/docs/userguide/tutorial_java_projects.html



If you don't want to split your build up into multiple projects, you
could use the web application quick start sample. There's an
(incomplete) walk-through at
http://www.gradle.org/0.6/docs/userguide/web_project_tutorial.html



One thing these samples don't do is produce an EAR task. You can either
use the Zip task, or Ant's Ear task in  your build. You might want to
have a look at
http://www.gradle.org/0.6/docs/userguide/java_plugin.html#N112B3 for
information about adding archives to a project.




  
    
      
        Does anyone have an example of how to use Gradle to
build  typical J2EE project - a .ear containing multiple .wars and
.jars?

        

Thanks.

        
      
    
  
  


 



      




      

Reply via email to