Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Finding it really difficult to understand Gradle

Options
  • 11-07-2014 5:14pm
    #1
    Registered Users 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 Posts: 2,646 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