Let me think about verification libraries, which is exist in .jar and which we should download. In other case, you can provide several type of product flavors. And after this just select Build Flavors for your work.
productFlavors {
fastDebug {
applicationIdSuffix ".jar"
}
regularDegub {
applicationIdSuffix ".regular"
}
....
// Other Configuration
}
dependencies {
...
// Jar Debug by adding only Jar
fastDegubCompile fileTree(dir: 'libs', include: '*.jar')
fastDegubCompile 'com.android.support:support-v4:23.1.1'
...
// Regular Debug with downloading all libraries
// Including only specific from project files
regularDegubCompile 'com.squareup.picasso:picasso:2.5.2'
regularDegubCompile 'com.android.support:support-v4:23.1.1'
regularDegubCompile files('libs/specific1.jar', 'libs/specific2.jar')
}
| UPDATE |
So after some workaround, I see that Gradle gathering libraries into some cache, where i can see source. But I still searching to way of correct verification libraries with project configuration.
For now i wrote script for gathering Files from Gradle cache location. And copying them into new location, where we can use build flavors,. This works really quick (less that 7 seconds for 200 libraries), but still need improvements (see above).
if I do not have time, for the next update, please, fill free to extend solution. Thanks for understanding.
// Task for calling from Gradle Scripts
// -----------------------------------
task gatheringJarFilesTask << {
println("Gathering Jars Start...")
gatheringJarFiles(gradleCacheLocation, foundedJarsList)
println("------------------------------")
println("Gathering Jars End! Start copying!")
copyFiles(projectJarsLocation, foundedJarsList)
}
// Constants, which might be optimized too
// -----------------------------------
def gradleCacheLocation = '/home/kasyangenka/.gradle/caches/modules-2/files-2.1'
def projectJarsLocation = '/home/kasyangenka/Projects/GradleScriptsTest/app/libs'
List<String> foundedJarsList = []
// Main Script Methods
// -----------------------------------
def gatheringJarFiles(baseDirPath, gatheredList) {
new File(baseDirPath).eachFile {file ->
println("-> Current file: " + file.getName())
if (file.isDirectory()) {
gatheringJarFiles(file.getAbsolutePath(), gatheredList)
}
def containsLib = (file.getName().contains(".jar")
|| file.getName().contains(".aar"));
if (containsLib) {
println("->> Adding Jar file: " + file.getAbsolutePath())
gatheredList.add(file.getAbsolutePath())
}
}
}
def copyFiles (destiny, List sourceList) {
sourceList.each {filePath ->
copy {
from filePath
into destiny
}
}
}
.aar
files? – Henigman.aar
becoming more and more popular. I'm glad to get any tipp, even if it only solves part of the problem – Maggiore--refresh-dependencies
) Local project are not rebuilt if their source does not change. The behavior you're asking for is already built into gradle dependency management and caching. What in gradle's default behavior is insufficient for your needs? – Lear