calatrava/calatrava — pull request #44 by KalyanAkella (2013-01-29 04:19:09+00:00)
Title: Android build fails first time

###### Issue
Upon generating a new Calatrava project and bootstrapping it, when the droid:build target is run, the compilation fails.

###### Reason
The IVY dependencies are fetched during the -pre-build phase and then passed onto the Java compiler through the classpath. However, this classpath is computed **_before_** the IVY dependency resolution (inside the -build-setup phase) and hence the classpath does not yet reference the newly fetched artifacts. In the subsequent builds, the classpath correctly references the dependencies as they are already fetched (in the earlier builds) and the compilation succeeds.

###### Fix
This patch proposes moving the IVY dependency resolution to the bootstrap phase. This means, all the needed *core* android dependencies are fetched upfront (like we currently do for Node and Pods) during bootstrapping so that droid:build target has everything it needs for a successful compilation.

###### Side Effects
1. Android build times are reduced as there's no IVY dependency resolution during regular builds.
2. The bootstrap target must be run when a new .jar dependency is added into the android app.
3. Android build lifecycle now looks more straightforward as there are no hooks into it. Note that fixing this problem by using other hooks like -pre-compile etc., will not work. Moreover, its not possible to cleanly set the classpath in our build files, without having to set internal android build variables.