Thursday, June 13, 2013

More Gradle

The work on Gradle support continues at a steady pace. There are some hidden thing that were needed to properly support these new projects where various folders with sources are created and removed as you build or clean projects. In addition to that there are some UI changes too. And it is time to bring in support for build configs and product flavors soon.

Some other changes are done in parallel: Jenkins build in now performed on a virtual server hosting nbandroid.org site. I thought about various free build services. The problem is that we need to build against NetBeans modules and some of their test JARs. This is not so bad. But we also need Android SDK and test against various target platform that are installed there. Luckily the SDK can be installed in a headless mode. It consumes some gigabytes of disk spaces and this makes it impractical to spawn a build server somewhere and clear it up after build. I am not mentioning NBM signing and other things. They all have solution and I just looked for the simplest one. Take it as a reminder that the project has its costs and can die without support.

Monday, June 3, 2013

Gradle branch merged

Good news for anyone who wants to try new build system for Android projects announced at Google I/O based on Gradle. Our feature branch is now merged into regular nbandroid sources and the first early-early preview is available from our update center together with latest version of Attila Kelemen's Gradle plugin for NetBeans.

Needless to say that this wouldn't be possible without Attila who made plenty of changes in his plugin to open it for extensions like Android. Thanks a lot. As you can see we did it in less than three weeks and we know there are many more things that needs to be done.

What is working and what is not:
  • Android projects based on Gradle are recognized. Gradle 1.6 (or newer) and Android's Gradle plugin 0.4 or newer are required.
  • Build and run actions are tied to assembleDebug tasks (note that sometimes you have to set location of Android SDK in Tools | Options | Miscelanelous | Android to enable communication with the device).
  • Classpath is hard-coded to use debug buildType at the moment and recognizes dependency on JARs and AARs but surely there will be various glitches.
  • Run tries to deploy the application and starts its main activity. Customization of this behavior will be added.
  • UI in projects tab will be modified soon to better accommodate all the parts of Android project.
  • Support for test editing and running is not there yet.
  • XML editing should be on the same level as for the original project type.
  • As a side effect when using Gradle projects for pure Java development with both Gradle and NBAndroid plugin installed there will be some performance penalty during project initialization.
Final note: the functionality will be locked to NBAndroid.org subscribers soon to get funding for this project. If you want to see this effort completed consider the subscription now. I have to repeat this again: Oracle (owner of NetBeans) is not investing here and you cannot expect it at least until their lawsuit against Android is solved and there is no sponsoring from Google either which is even more sad as they now directly support Eclipse and their IntelliJ based Android Studio.