I just playing around with the gradle plugin from the android tools project site and it feels quite hard to figure out how things should work. It is not very good integrated into the eclipse development work flow, even default project configuration for eclipse did not work for me. It is possible to fix this by extending the project and classpath file creation and modifying the project layout inside the gradle build file.
For fixing the eclipse project creation I got inspired by the plugin from jvoegele (credits go there):
eclipse{
project {
natures "com.android.ide.eclipse.adt.AndroidNature"
def builders = new LinkedList(buildCommands)
builders.addFirst(new BuildCommand("com.android.ide.eclipse.adt.PreCompilerBuilder"))
builders.addFirst(new BuildCommand("com.android.ide.eclipse.adt.ResourceManagerBuilder"))
builders.addLast(new BuildCommand("com.android.ide.eclipse.adt.ApkBuilder"))
buildCommands = new ArrayList(builders)
}
classpath {
containers.removeAll { it == "org.eclipse.jdt.launching.JRE_CONTAINER" }
containers "com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"
plusConfigurations += configurations.compile
file {
whenMerged { classpath ->
classpath.entries.removeAll { it instanceof SourceFolder && (it.dir?.path == "gen" || it.dir?.path == "src") }
classpath.entries.add(new SourceFolder("gen", null))
classpath.entries.add(new SourceFolder("src", null))
}
}
}
}
If you want to get your project fast to be productive, this is plugin not suitable for you.