Ivy 'buildlist'-style build ordering with Gradle?


(Andriy Vlasov) #1

Hello Gradle community,

I apologize if this has been asked before (please point me to a correct thread if this has already been discussed).

we have an old Ant/Ivy-based multi-project build infrastructure which we’re trying to migrate to Gradle. there are 30+ subprojects and some of them depend on each other’s artifacts.

one feature people really like is the ability to build only the subproject they’re working on. Everything else is fetched from Artifactory. if they need to rebuild the entire stack, they simply run the top level script, which figures out the build order using Ivy’s ‘buildlist’.

as far as I understand from The Manual, Gradle’s multi-project builds can be used to achieve a similar effect, but it seems that if project B declares a dependency on project A, then if I need to build B, Gradle will try building both.

for this to be efficient, the Incremental Builds have to be configured really well and our projects are quite far from that point at the moment for several reasons.

so what we’d like to do is :

every single subproject behaves as an ‘independent’ project (fetching dependencies from Artifactory if needed)

the top level build figures out the build order using subprojects’ dependency declarations

can this be done with Gradle in some non-hacky way? :slight_smile: if not - can you please provide some suggestions as to how this (or similar) behavior can be achieved with Gradle?

Thanks in advance


(Peter Niederwieser) #2

This has been discussed a number of times. It’s a planned feature but not yet available. Some users have implemented it on their own, but it takes effort and isn’t the same as having it natively supported. If you need this today, have a look at https://github.com/pniederw/elastic-deps (an old proof-of-concept of mine) and Prezi’s https://github.com/prezi/pride (a more recent and more advanced implementation). The latter is likely your best bet for now, and perhaps it’s all you need.


(Lóránt Pintér) #3

Pride is created for this purpose. It requires that your modules reside in separate repositories (Git for now, but adding other VCSs should be easy if you are willing to contribute).