I've been using Gradle extensively for a few years now and it's a great tool. 
Basic builds following standard Maven directory
structures are very easy, but it is flexible enough to do anything you can 
imagine (from my experience so far anyway...).

Dependency management is very good, with lots of options to manage transitive 
dependencies and such. There is even a handy plugin to
check for updates to dependencies. More generally the combination of scripting 
tasks using Groovy and a wide variety of plugins
makes it a very powerful tool. I imagine a lot of the same things can be done 
with Maven, but I doubt as much or as conveniently (I
don't have as much experience with highly custom Maven builds to compare 
though).

Gradle allows you to set the Java version to compile for (targetCompatibility 
and sourceCompatibility fields), and though I haven't
tried it you should be able to build for multiple Java versions with no issues 
in different modules or maybe even in the same module
with different build tasks.

There is pretty good support for running ant tools as well, a nice fallback for 
things that are easier in Ant. I used that quite a
bit early on with Gradle, but rarely do so now as Gradle has good ways of doing 
most anything.

One downside to Gradle is that it is much heavier than Ant in terms of system 
resources on your dev machine. For me this isn't
generally a big deal, and while the Gradle Daemon makes stuff build just as 
fast as Ant it hogs some memory (only an issue on my
little travel laptop which has more limited memory).

I don't think this sort of thing will be a big deal for FreeMarker, but in 
Moqui Framework (and more recently in Apache OFBiz)
Gradle is used to handle more complex multi-module builds including handling 
modules dropped in and 'auto discovered' using a little
method in the settings.gradle file, plus in Moqui things like automatically 
getting dependent components (a framework level thing,
not a Java thing) using configuration in XML files that are framework specific 
using the convenient XML parsing and such that is
part of Groovy.

In short I'd highly recommend Gradle. The documentation for the API and such is 
good and these days there are lots of people using
it so there are many plugins available and you can find solutions to just about 
anything with a little googling.

-David


On Wed, 2016-09-21 at 19:49 +0200, Daniel Dekany wrote:
> Hi,
> 
> In FreeMarker 3 we want to modularize the project, so that there will
> be at least a freemarker-core and then a separate artifacts for each
> extension (like freemarker-jsp, etc.). Thus so far I agree with what
> you are doing. If it can be done with FreeMarker 2 though, I'm not
> sure, because we have to keep strict backward compatibility there, and
> also we have to consider how much hassle such a change causes for the
> users. (There are orders magnitude more users than contributors.
> Something that's nice for the contributors might bears no value for
> the users, or even just makes dependency management more fragile for
> them.)
> 
> As of a monolithic Maven build (where the point is to migrate away
> from Ant and make the build more "standard"), there was such activity,
> but it didn't get far enough so far:
> https://issues.apache.org/jira/browse/FREEMARKER-7?jql=project%20%3D%20FREEMARKER
> 
> The main problem is that in FreeMarker it happens now and then that we
> have to depend on multiple versions of the same artifact (or on
> multiple versions of the Java platform). Ant can handle that, but
> Maven... well, perhaps if we extract parts that are above the baseline
> platform (Java 5 currently, but let's say Java 6) into separate
> artifacts, like freemarker-core-java-8 and such, but that won't be
> backward compatible as users had to depend on them explicitly (I
> guess), and even if we consider FreeMarker 3, it might complicates the
> life of users. So perhaps we have to look into using Gradle. (Gradle
> can be also handy if we want to target Android, and with in FreeMarker
> 3 we surely should.)
> 
> Also, there are quite a few extra steps and extra tasks, if you look
> into the build.xml. Though I guess most of them can be reimplemented
> in Maven gradually, and we can keep the Ant build until it's done...
> 
> 
> Tuesday, September 20, 2016, 10:03:56 PM, Mauricio Nuñez wrote:
> 
> > 
> > Hi all,
> > 
> > I'm a older user of freemarker, from version 1. Today, I'm working in a
> > maven pom.xml  for freemarker. Freemarker is very valuable for me, and I
> > want to contribute. My old web site ( www.chile.com )  is down now, but it
> > was developed with freemarker about 2002-2003.
> > 
> > I'm using a maven plugin for javacc, and this build is working. I have some
> > issues with some JUnit tests, but I'm working in that ( I guess the problem
> > is related to my Locale )
> > 
> > But my approach is to create a base freemarker project, and a second
> > project, related to extensions ( jython, servlet, etc ). Before continue, I
> > want some comments from you.
> > 
> > Regards,
> > 
> > Mauricio

Reply via email to