Hacker News new | past | comments | ask | show | jobs | submit login
Gradle 2.0 (gradle.org)
95 points by pennaMan on July 2, 2014 | hide | past | favorite | 47 comments



Since I was unaware of what it is:

> What is Gradle?

> Gradle is build automation evolved. Gradle can automate the building, testing, publishing, deployment and more of software packages or other types of projects such as generated static websites, generated documentation or indeed anything else.


I port my iOS App to Android, Android Studio, Gradle and Maven dependencies management are the best things for any Android dev ever. Gradle build scripts and configuration are totally awesome. Dependencies management just work.

Basically, if you're using Eclipse and Ant for a new Android app, you're doing it very wrong.


> Basically, if you're using Eclipse and Ant for a new Android app, you're doing it very wrong.

Until they fix the performance problems I will keep using Eclipse, even though I am not a big fan of it.


To those that downvoted me this was discussed at Google IO.


What performance problem? Android Studio is like, 2 times faster than Eclipse. If you talk about gradle build, yeah it kinda slow, but I'm ok with that.


Ant is... well let's just say if you're using Ant you're doing it wrong ;) (or that's a very-old-legacy-stuff)


Old doesn't mean it is bad. Still ant is so much faster than gradle and maven.


Yes, speed matters for builds if you need to rebuild and retest after every source edit. And despite Gradle finally upgrading to Groovy 2, it still uses the ancient Antlr 2 based grammar which is even more ancient than Ant.


Recently, I had to write some code for an Android app (in Java, of course) and Gradle was the most pleasant thing about all of it. I think Android Studio would have perhaps surpassed it, had I used it more.


Gradle is fantastic and hopefully it helps bring awareness to the under appreciated groovy language.


I certainly appreciate the syntactic sugar of Groovy as a clear improvement over vanilla Java. But with time as a scarce resource I've opted to learn Scala and Clojure instead. It would be great if somehow we could smush Gradle and sbt together to build a best of all possible worlds build system for Scala.

Back in 2009, James Strachan (the creator of Groovy) stated that if he'd known about Scala first he probably wouldn't have built Groovy [1]. This Dr. Dobb's article [2] also has some good points on evaluating Groovy and whether or not it will continue to thrive. The simplicity of its syntax vs scala is a great point for Groovy though.

[1] - http://macstrac.blogspot.com/2009/04/scala-as-long-term-repl... [2] - http://www.drdobbs.com/jvm/the-groovy-conundrum/240147731


> It would be great if somehow we could smush Gradle and sbt together to build a best of all possible worlds build system for Scala

www.gradle.org/overview does say "The Gradle design is well-suited for creating another build script engine in JRuby or Jython. It just doesn't have the highest priority for us at the moment. We happily support any community effort to create additional build script engines."

I have looked at the Gradle source code and Groovy seems to be tightly entangled in it, and it would be difficult to get Gradle to use another DSL language. I'm also doubtful about what they say about happily supporting community effort to create other script engines. Based on my previous experience with the people behind Groovy, not only with regards to the Groovy++ fiasco of mid- to late-2011 but many times before, that line could easily mean "We're happy to hear about any community effort to create additional build script engines so we can scuttle your attempt before it gets very far."

> The simplicity of its syntax vs scala is a great point for Groovy though

Did you say Groovy's syntax is simple? The Gradle DSL is just a tiny subset of Groovy's grammar, see [1]. It's also still stuck on Antlr 2 because no-one wants to try upgrading it to Antlr 4. Scala was designed so its grammar would be light and the functionality residing in the libraries.

[1] http://svn.codehaus.org/groovy/eclipse/trunk/base/org.codeha...


Thank you for these links! I love programming history and the many things you can learn about your tools.

I am stuck on a few projects at work using Groovy/Grails. Groovy itself has been fine and I regularly switch between Groovy, Python and JavaScript with little more than a Google to double check syntax.

However dealing with Grails is a damn nightmare. I recently ran into a bug where grails parsed a parameter query variable containing a nbsp symbol. Instead of giving me a string with an nbsp character, it inserted an "A" with an accent mark in addition to the ndbsp character. Two for the price of one!

The best part was, this only happened after I compiled the app to a war file so it didn't show up in development.

This is the 3rd parsing bug in grails I have found in the last few months alone.

Another one was the when using "render as obj as JSON" shortcut for controllers. The parser was converting "</" characters into a single Unicode character. Causing the HTML string I was trying to render break. However doing the conversion to JSON manually in a service class and setting the right response headers then returning the JSON string worked fine.

The third one was XML builder. Errors are thrown if I have empty leaf nodes (at a minimum I need to add {} to the end of leaf nodes). Only works in dev however as gain when I build the war it does not work at all. Instead I just build my XML string manually.

The final thing I don't care for is the GORM. We have never gotten DB auto reconnect to work with any MSSQL server or DB2 in the last 2 years (that we have been actively trying to get it to work) across 4+ applications.

tl;dr

Groovy is OK but Grails is a total PITA.


> Back in 2009, James Strachan (the creator of Groovy) stated that if he'd known about Scala first he probably wouldn't have built Groovy [1].

I wish people would stop quoting this as if it is some kind of damning evidence against Groovy as a language. It is sad because I often want to say generous things about frameworks and tools that are competitors to ones I am involved in, but then I remember how ruthlessly and persistently people exploit this line (almost guaranteed to get quoted in every Scala discussion if someone mentions Groovy) and I realise that in the real world you can pay a lot for being generous at the wrong time.


Very True. I'm pretty sure that quote wasn't meant to be a critique of the Groovy language, just an expression of interest in Scala. Yet its brought out every time somebody wants to dismiss Groovy.

Compare that quote to this[1] presentation where Paul Phillips lays in to scala for 50 minutes. Even when somebody does criticize their own creation I doubt they mean "Hey everybody, that thing I spent a bunch of time on? Throw it all in the garbage, its pointless".

[1]https://www.youtube.com/watch?v=TS1lpKBMkgg


Don't most people in the JVM ecosystem know about groovy by now? I first heard about it when Maven 2 betas were coming out and it was the preferred way to write a plugin.


I find awareness of groovy very spotty depending on the crowd you travel in.

Enterprisey J2EE people regard it as a new fangled something they don't have time for.

More pragmatic, hip to it programmers seem to give more attention to scala, clojure, jruby.


I guess I fall somewhere in between then. :-)

Our startup is writing "enterprisey" B2B knowledge management software, but almost all of our code is written in Groovy. But I'm "hip to it" enough to at least own several Clojure and Scala books and have both on my "to learn" list. shrug

Personally I'm a big fan of Groovy. It gets an awful lot of things right, IMO. The syntax is mostly a superset of plain Java, but a lot of things that are required in Java are optional in Groovy. But Groovy is dynamic and has meta-programming, closures, dynamic typing, etc. For my money, it really hits the sweet spot. Easy to learn for a Java person, but way more productive than Java.


>Easy to learn for a Java person, but way more productive than Java.

Agreed, which is why it such a shame it isn't more prevalent.

Along with the features you mention, I'll add, good repl support, which is a must for modern languages in my book and is a huge productivity boost.


> Enterprisey J2EE people regard it as a new fangled something they don't have time for.

Back when I was part of a project that was developing a JSF framework on top of RichFaces, I started pushing for Groovy support on our SDK.

This was 2009, Groovy was everywhere on JUG talks in Germany, most talking about Grails success stories. On the same year while attending JSF Days in Austria there were some Oracle guys showing how to do JSF applications in Groovy and the possible inclusion the the next J2EE revision.

Other team on the same company was replacing the Perl battle tested installation scripts by Groovy ones.

Nowadays, if it wasn't for Android Studio and its dependency on Gradle, I would hardly notice its use.


Groovy's problem is that it's very slow compared to Java. http://java.dzone.com/articles/java-7-vs-groovy-21


Names do have some importance. Calling your programming language Groovy is like calling it "Sweet Hotness." Nobody wants to explain to their boss that they think they should write something in Sweet Hotness, and likewise Groovy.


I guess you never had the "We're switching from SVN to git" conversation.


as another "enterprisey" type I vastly prefer clojure or scala. either go full on static typing or full expressivness. groovy is too middle of the road for me.


I've used Groovy extensively for 4 years or so now. A product we used that ran on JBoss decided to use it as the plugin language to extend / use internal APIs. I really pity Java people who don't know or haven't used Groovy yet. It's like embedding Lua into your C app. Why people still write the bulk of their code in pure Java is beyond me.

The other day I learned that Solr supports Groovy as an embedded language to write extensions in. It's amazing.


> hopefully [gradle] helps bring awareness to the under appreciated groovy language

If Groovy's still under-appreciated after 10 years, there's got to be a reason.


You say that with intent to imply it must be a bad reason, it's a little underhand. There are lots of reasons Groovy is not well appreciated. It's name is terrible, the community has always had a somewhat amateurish image (in stark contrast to the actual professionalism of what they do), it's choice to blend in seamlessly with Java and adopt as much Java syntax as possible made it decidedly unsexy with the crowd want to push new language concepts. It got a bad reputation for being slow early on (quite undeserved since it was always about as fast as comparable languages).

I think it's actually used incredibly widely but people don't even know it, Gradle being an example, but lots of other similar cases. Groovy just doesn't get credit a lot of the time because it embeds so seamlessly in to the Java world.


I think this due to Groovy's fragmented ecosystem (Groovy's 2 big recognizable projects, Grails and Gradle, don't play well together) combined with the fact that you can't use Groovy everywhere you use Java.



Why is nearly everyone who tries to drum up publicity here so clueless as to assume everyone knows what their product/app/library/whatever actually is?

What a terrible waste of publicity.

The very first sentence in any link should at least give a hint what the thing in question is and if it doesn't, it should not appear on Hacker News.


I don't think Gradle needs to spam HN for publicity. It is the #2 (subjectively ranked) build system for Java and other JVM-based languages, and is arguably on the cusp on overtaking Maven for the #1 spot if it has not done so already. It has a pretty tight relationship with Spring and Grails, two of the top three frameworks for doing Java web development.

If you've done any real Java development within the past five years, then you at least know what Gradle is. If you haven't, then you won't, and that is perfectly okay. Frankly, this maxim is true of half the announcements on HN. If I don't recognize something at all, then usually it's a random Rust or Julia thing... and I've grown to conditioned to simply ignore it and skim onward.

I do agree that any public announcements SHOULD include a blurb for the new people who are hearing about the subject for the very first time. As far as HN irritations go, however, that bothers me a lot less than the tendency of announcement threads to turn "meta". Fewer comments on the subject matter itself... more comments on the announcement’s font selection or color scheme, copy verbiage, logo design, or just completely random digressions to discuss why Rust does it better, etc.


Does Grails and Gradle really have a tight relationship? In the past my experience has been that these two work really poorly together. Has this changed?


Both Grails and Gradle ship with the Groovy Language, and are its main two products by number of users - if they disappeared, Groovy's only use of any significance would be short scripts manipulating and testing Java classes. (Though I'm not sure if I'd describe Gradle build scripts as "using" Groovy, more like 50 lines using a tiny subset of Groovy's grammar and functionality.)

And of course Grails is promoted by VMWare and Gradle by GradleWare. There's no info about GradleWare's true owners in the verbiage on their about page. Either they want to be bought by VMWare, or they were started with seed money from them and effectively controlled by them.


I doubt it, if it wasn't for Android everyone would still be split between Ant and Maven.

I am yet to touch Gradle outside Android projects.


Spring documentation and example apps these days are primarily Gradle-based, with Maven as a secondary option. I don't see Ant or Maven being displaced on very mature legacy applications, but my anecdotal sense is that Gradle already has the lead now in new greenfield development.


Gradle is a build and dependency management tool for Java projects. It's been gaining popularity over alternatives like Ant. In my opinion, it has way to many features coupled into one product, but it's slowly becoming the standard.


I thought that many of the "features" are simply Gradle plugins that they happen to ship with the core product. In that case I'm not sure I'd call that too many features. Seems more like a good core product with a great extension mechanism.

I don't use Gradle on anything at the moment, though I've looked into it a few times as a possible replacement for maven on my team.


I have that sense as well (that it has way too many features). For example, I really question the decision to add C/C++ support.


Those of us working on Android have apps that combine Java and C/C++, so it could be very helpful. (I'm still sticking to ant and make though.)


Personally the C/C++ is very attractive.


Who says this is an attempt to drum up publicity? It's an announcement to the Gradle community, who presumably knows what it is and wouldn't be very interested in an explanation. Someone posted it to HN because they thought people interested in Gradle would care about the announcement, not because HN is a marketing channel. More generally, you are not the target audience of everything posted to the internet, or even of everything of interest to HN. That's OK.


Anyone interested in Gradle already knows about Gradle 2.0's release, or will when they next read their email or twit feeds. This announcement on Hacker News is an attempt to market Gradle. The announcement submitter's username was created specifically to submit the article.


Meaning, for example, the tweet that links to this article? [1] Doesn't look like they have a current mailing list other than notifications from...the forum this article was posted in. If they wanted to market Gradel to HN (rather than simply spread the word that they have a new release to the intersection of the two communities), they'd presumably use, you know, marketing material. After deciding that they're doing X, complaining that they didn't do even the most obvious thing required to succeed at X is a pretty good sign that they weren't trying to do X in the first place. "Your post is the worst attempt to write a novel I've ever seen!"

[1] https://twitter.com/Gradleware/status/48388354498154496


Are you joking ? I have been doing Java development for a decade now and would never have heard about this. It's always interesting hearing about major product releases.


I'd also add that my instinct was to click the Gradle logo, hoping to land at their homepage which should explain what Gradle is. Instead, it brought me to their forums.

I wonder how many other visitors were lost this way (Google Analytics should know, look for people going from this post to your Forums via the logo, and then exiting).


While Gradle is quite popular, I agree with the general sentiment of this comment.


What do you expect when the first sentence on their site is "Gradle is build automation evolved.". How informative.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: