File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed
Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change 1818
1919import groovy.json.JsonSlurper
2020import java.nio.file.Paths
21+ import java.util.regex.Matcher
22+ import java.util.regex.Pattern
2123
2224apply plugin : " com.android.application"
2325
@@ -403,12 +405,20 @@ task extractAllJars {
403405 outputs. dir extractedDependenciesDir
404406
405407 doLast {
406- def iter;
407- if (project. selectedBuildType == " release" ) {
408- iter = configurations. releaseCompileClasspath. resolve()
409- } else {
410- iter = configurations. debugCompileClasspath. resolve()
408+ def buildType = project. selectedBuildType == " release" ? " Release" : " Debug"
409+ def iter = []
410+ Pattern pattern = Pattern . compile(" ^(.+)${ buildType} CompileClasspath\$ " )
411+ configurations. all{ config ->
412+ Matcher matcher = pattern. matcher(config. name)
413+ if (matcher. find() || config. name == " ${ buildType.toLowerCase()} CompileClasspath" ) {
414+ config. resolve(). each {
415+ if (! iter. contains(it)) {
416+ iter. push(it)
417+ }
418+ }
419+ }
411420 }
421+
412422 def dependencyCounter = 0
413423 iter. each {
414424 def nextDependency = it
You can’t perform that action at this time.
0 commit comments