Is it possible to generate Eclipse and Intellij project files for Android projects using Gradle?
In maven we would do mvn eclipse:eclipse
and in PlayFra
The following worked for me
eclipse.classpath.plusConfigurations += configurations.compile
eclipse.classpath.file {
beforeMerged { classpath ->
classpath.entries.removeAll() { c ->
c.kind == 'src'
}
}
withXml {
def node = it.asNode()
node.appendNode('classpathentry kind="src" path="src/main/java"')
node.appendNode('classpathentry kind="src" path="src/debug/java"')
node.appendNode('classpathentry kind="src" path="gen"')
node.children().removeAll() { c ->
def path = c.attribute('path')
path != null && (
path.contains('/com.android.support/support-v4')
)
}
}
}
eclipse.project {
name = 'AndroidGradleBasic'
natures 'com.android.ide.eclipse.adt.AndroidNature'
buildCommand 'com.android.ide.eclipse.adt.ResourceManagerBuilder'
buildCommand 'com.android.ide.eclipse.adt.PreCompilerBuilder'
buildCommand 'com.android.ide.eclipse.adt.ApkBuilder'
}
Source - http://blog.gouline.net/2013/11/02/new-build-system-for-android-with-eclipse/
Sample - https://github.com/krishnaraj/oneclipboard