Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.
Hi all, please see this major site announcement: https://www.boards.ie/discussion/2058427594/boards-ie-2026

Finding it really difficult to understand Gradle

  • 11-07-2014 04:14PM
    #1
    Registered Users, Registered Users 2 Posts: 1,019 ✭✭✭


    Hi,

    Just wondering if anyone has any tips/links/resources for Gradle? I've spent hours at this stage trying to get my head around it but I really can't seem to get it, at all. I don't understand how it works at a high or low level.

    I'm a Java developer and trying to get up to speed with Gradle because I'd love to move our current build away from Ant. It has become a monster and I think Gradle might help clean it up.

    For example: today I tried to write a task to unzip an archive. Ended up copying this from an article:
    task unzip(type: Copy) {
        def zipFile = file("D:/archive.zip")
        def outputDir = file("/unpacked/dist")
    
        from zipTree(zipFile)
        into outputDir
    }
    

    But then I realised I wanted a generic unzip task which I could change the archive/output directory for.

    This seems like it should be really straightforward but I can't figure it out. Which makes me think I've obviously misunderstood how the whole thing works. With other technologies I normally take some time to read/understand and then can figure things out but with Gradle I'm still stuck at 0 :(

    Any advice?

    Thanks


Comments

  • Moderators, Sports Moderators, Regional Abroad Moderators, Paid Member Posts: 2,692 Mod ✭✭✭✭TrueDub


    Are you doing lots of bespoke things in your build, or is it a pretty standard compile-test-assemble build?

    If it's pretty standard, I'd suggest looking at Maven, rather than Gradle. IMO, Gradle is excellent when you need to do unusual things, as the scripting is excellent, if a little obscure. However, a lot of Gradle builds I see simply implement the Maven plugin, and don't do anything that Maven wouldn't do.

    All my opinion, of course, your mileage may vary.


Advertisement