Before I joined my current company, I was an avid JetBrains IntelliJ IDEA user, both professionally and personally. When I joined my current company it turned out that most of their internal tools had plugin support only via Eclipse and I settled in to start understanding and accepting Eclipse again. I even started to use it personally because I was messing up all the keyboard commands. I’ve switched teams a few times in my current company (from ACX, to the web team, to Discovery, and now to the Android team). When I switched to my most recent team we were using Eclipse with the ADT plugin, as well as the Android Ant-based build system. It was pretty atrocious getting everything to work well together. When Google announced its new build system, we decided to jump on it, thinking its better to be ahead of the curve and not stuck on the mediocre Ant build system.
We’ve been pretty happy with the new build system, using plugin versions 0.2 and 0.3 mostly (0.4 was announced on the same day as Android Studio). We’ve had to accept some of its short-comings or work around certain things:
- lack of integration with the Java plugin – this lack of integration means that certain plugins (such as Cobertura, Licensing, etc.) cannot be currently used when the Android build system is in play. This is apparently because the Android plugin doesn’t use standard source sets which are required for proper compatibility. The Android team is apparently working with Gradleware team to make required changes to get this compatibility back.
- its in flux – every plugin revision (0.2 -> 0.3 -> 0.4) has required some change to our build.gradle files in order to actually now work. The changes typically aren’t huge but depending on how quickly you jump on the new plugin, they may not be documented yet. I’ve found that having the source code checked out combined with generating debug level messages for a Gradle error has allowed me to figure out what changed.
- lack of Eclipse support – The Eclipse plugin as of right now had not been upgraded to work with the Gradle-based build system. This is not much of an issue now that Android Studio is out, but if you prefer Eclipse (apparently still needed for Native support), you’ll need to accept a few things:
- You can’t completely use the new Gradle directory structure – Eclipse expects the AndroidManifest.xml and the /res directory to both be off the root. Placing them anywhere else causes the Eclipse plugin to complain.
- You’ll need to roll your own additional Eclipse configuration. I had additional configuration in place to look for the existence of src/main/java, src/main/aidl, src/test/java, etc. and manually add them to the Eclipse XML file. Similarly, you need to add the required Eclipse project natures, etc. manually. We’re migrating to Android Studio so I’ve deleted that code now and moved our files to their proper locations.
- Lack of understanding of typical configurations – we had to define the testCompile configuration in order to have separate configurations. I expect this to go away with proper Java plugin integration.
configurations { testCompile }
As you can see, we’ve encountered a few issues that we either worked around or accepted. You obviously may encounter more or less issues depending on your project complexity. Overall, I think jumping on the Gradle plugin has made us more productive:
- Proper project dependencies definition – easy for us to tell what we’re depending on plus we’re not relying on binaries in source control
- better ecosystem and configuration – plugin availability (especially once Java integration works) along with a clear concise way to script things or reference plugins (I always found it personally annoying to rely on an Ant task).
- industry standard directory structure – whether you love or hate Maven (I happen to be okay with it), their standardization/conventions for directories is quite handy and nice.
The Gradle plugin on its own is nice, but combined with Android Studio, my developer happiness has skyrocketed. Usage of the Android Studio has been quite pleasant so far (though the IDEA key commands are only slowly coming back to me) and its obvious some pretty decent effort has been put into the Gradle integration. That said, some things I’ve encountered so far:
- Surprise, it needs Gradle 1.6 and plugin 0.4! – somewhere people forgot to make the 0.4 announcement. Its in the Maven repositories though. Plan on using it if you want to use Android Studio
- Closing and Opening a Project – I’ve gotten some weird dependency stuff or that the project doesn’t auto-update. Closing/re-opening solves all these issues. I need to confirm if I forgot to turn on auto-import (normal IDEA has that for Maven projects) or if there is some weird bug.
- Modules depend on the Android Library – I’ve found that modules that depend on other modules are relying on the compiled Android Library file, which has basically forced me to associate that binary file with the source project manually in order to click through to the source. Strange. I am assuming it will get fixed.
- build directory clean up – I found in a few instances it wasn’t cleaning up build directories correctly. I had deleted some AIDL files and the compiled/generated code was still in the build directory causing confusion when I went to rename something.
Even with these issues, if you were a former IntelliJ IDEA user who settled for Eclipse while doing Android development, I encourage you to not be scared of the “0.1″ version number and give it a try. Even with these minor issues I’ve been much happier (and also not getting out of memory exceptions like I was in Eclipse despite giving it 2gb of memory!). I’ll continue to post my impressions as I use it longer and continue to upgrade Gradle versions and Android Studio versions.



































































































































































































































































































