Hi,
I am trying to point Android Studio and Gradle at the same local Maven directory to avoid downloading duplicate files when building in Android Studio and via Gradle on the command line.
Android Studio uses MAVEN_REPOSITORY which points to ~/.m2/repository. This can easily be changed. Gradle uses ~/.gradle. More specifically, it looks like the the files are stored in ~/.gradle/caches/artifacts-24/filestore.
Q: Is there a way to configure the location Gradle uses for Maven? NOTE: I am using Gradle 1.6 and the /usr/bin/gradle script is the same as the one provided by gradlew (except it runs org.gradle.laincher.GradleMain).
Q: Is it possible to force Android Studio to let Gradle handle the Maven repository dependencies (so the behaviour is the same between the two)?
With Android Studio, the Maven repository looks like:
com/google/android/support-v4/r7/support-v4-r7.jar
com/google/android/support-v4/r7/support-v4-r7.jar.sha1
com/google/android/support-v4/r7/support-v4-r7.pom
com/google/android/support-v4/r7/support-v4-r7.pom.sha1
whereas with Gradle, it looks like:
com.google.android/support-v4/r7/jar/24d0f6da34c3a2bfcf736ab42d51c91ac821ee22/support-v4-r7.jar com.google.android/support-v4/r7/pom/aef29a63d7075a26930b0c67f1333729be7c4a6e/support-v4-r7.pomQ: Why are these layouts different?
Additionally, I have noted that Gradle 1.6 uses the maven 3.0.4 plugin, whereas Android Studio 0.2.0 uses maven 3.0.3 (it also has maven 2.2.1 installed).
NOTE: It looks like Android Studio uses Maven 2 by default. I am not sure, as the only reverence to 2 vs 3 is in "Maven > Importing > Use Maven3 to import project". There is no option about Gradle using Maven 2.
Q: How do I make the builds consistent between Android Studio and the Gradle command line?