While the Gradle manual is extensive, since we’re not building an executable or the like from source code, many of the concepts are a little opaque. Here’s a quick primer on Gradle for BI:
Gradle is “project” based, with each project containing a set of inter-dependent tasks which in turn contain actions:
The whole thing is configured in a build.gradle file. Wherever you put this file becomes the root of your project. In that file you can manually add tasks and/or apply plugin(s). Plugins then in turn add tasks relevant to their purpose.
Things that we’ve found helpful in developing for BI:
- Try and find commonalities between the out-of-the-box plugins and features and what you’re working on. For example, we extended the Exec plugin for sqlcmd execution with a set of options specific to our need, and we didn’t have to reinvent things like PATH handling.
- Conventions are your friend. They pre-suppose how things should be laid out and then allow you to selectively modify that assumption.
- Custom plugins are (relatively!) easy to develop – so decide what functionality you’ll use over and over and create your own plugin for re-use.