views:

158

answers:

1

We have several independent builds (each independent build is a multi-project build). The main build scripts become quite big as we have a set of common tasks reused by subprojects as well as there is a lot of repeation between indepedent builds. What we are looking for is:

  1. A way to split main build file into smaller files
  2. A way to reuse some parts of the build in other independent builds

What is the best way to achieve that in Gradle?

+1  A: 

Gradle 0.9 allows you to import a build script from another build script. Have a look at: http://gradle.org/0.9-preview-1/docs/userguide/tutorial_this_and_that.html#sec:configuring_using_external_script

One thing the user guide doesn't mention is that the 'from' parameter can be a URL, so you can make your shared scripts available via HTTP somewhere (eg your subversion repository), and import them from multiple builds.

Adam Murdoch
Thanks for the link. Do you think 0.8 supports that feature?
Superfilin
No, it's a new feature in 0.9
Adam Murdoch