Gradle builds really slow with a multi-project structure.
I currently have this question asked at http://stackoverflow.com/q/21125302/427763.
When building with gradle on a multi-project setup containing roughly 140 projects/libraries, the build time took 1 hour and 22 minutes. And i was using --parallel. And our ANT build takes less than 20 minutes without parallel building.
Here is exactly what i did.
./gradlew clean ./gradlew build --parallel
I did a little testing it seems like the dexing is taking the longest amount of time. Is there a way to get the gradle process to re-use the stuff it has already dexed? If the libraries have already been built, it should re-use the already dexed libraries.
I saw the option --no-rebuild, but when i run with that option it says the following
File ‘/path/to/project/build/libs/project.aar’ specified for property ‘bundle’ does not exist.
I replaced the file path and project name with generic stuff.
Using Gradle 1.9-rc-3
After some more testing and answers from other people i have the build time down to 52 minutes. Which is still very unreasonable.
I added “preDexLibraries = false” to all the build.gradle files and i ran the following command:
This made it only do the debug. It seems as though it is not re-using the dexed files that it builds. Is there a way to further improve the build time? How can we get gradle to re-use those dexed libraries? It takes 1+ minute to dex each project.