How to use Gradle to generate Eclipse and Intellij project files for Android projects

Gradle itself is a generic build tool, it is not created specifically for Android.

All the functionality is enabled using plug-ins. Traditionally, build plug-ins don’t generate project structure. That’s the job of project specific tools. The Android plug-in for Gradle follows this.

The problem is that current android tool in SDK generates old type of project structure (ant builds). The new project structure can only be generated via Android Studio.

There is a concept of archetypes in tools like Maven, which allow using project templates. Gradle does not support that yet (requests have been made for this feature).

Refer to this thread: http://issues.gradle.org/browse/GRADLE-1289 , some users have provided scripts to generate structure.

Build Initialization feature is in progress: https://github.com/gradle/gradle/blob/master/design-docs/build-initialisation.md

Hopefully some one can write a script to do that, refer to this guide for new project structure: http://tools.android.com/tech-docs/new-build-system/user-guide

Update

There is now an official Android IDE: Android Studio . It is based on Intellij and the new build system is Gradle based.

Leave a Comment