There is NO NEED to add to the source control any of the following:
.idea/
.gradle/
*.iml
build/
local.properties
So you can configure hgignore or gitignore accordingly.
The first time a developer clones the source control can go:
That's all
PS: Android Studio will then, through maven, get the gradle plugin assuming that your build.gradle looks similar to this:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.12.2'
}
}
allprojects {
repositories {
mavenCentral()
}
}
Android studio will generate the content of .idea folder (including the workspace.xml, which shouldn't be in source control because it is generated) and the .gradle folder.
This approach is Eclipse-friendly in the way that the source control does not really know anything about Android Studio. Android Studio just needs the build.gradle to import a project and generate the rest.