I’m working on a build script with Gradle.
We have multiple projects at our company, some of which depend on one another.
In the past, each project has looked in our repository in order to resolve dependencies. We’d like to provide the option to build dependencies if they are not present in the repository, or if we know that the repository is out of date.
Say, for instance, we have project A and project B. Project B depends on A.
When we modify project A, we will deploy its artifacts to our repository. Then, whenever we build project B, we will pull down A in order to satisfy our dependencies.
However, some work on B may have required some updates to A in parallel. We could build and deploy A and then build B.
What we’d like to do is build A as part of B and avoid (or, at least, defer) the deployment of A and remove it as a necessity of building B.
Put another way, since building A means that our artifacts are already on the local machine, the deployment and then retrieval of A via our repository in order to satisfy B seems excessive and, at times, is inconvenient.
We’re still early in our understanding of Gradle; we’re migrating from Maven.
Are there any Gradle mavens ( ;o) ) out there who can advise?
Flexible project dependencies will be a major focus of Gradle 1.2 and beyond. As of Gradle 1.0, you’d have to implement this yourself. It’s doable (without touching the Gradle codebase) but may require a fair amount of work and Gradle skills.