[Gradle] Fix testResolveAllConfigurations
It should exclude certain kotlin source set configurations, that can't be resolved all the time for various reasons. Particularly `dependencySources` since not all dependencies has published source variants.
This commit is contained in:
committed by
Space Team
parent
c979e4e7be
commit
daa97f7ec9
+6
-6
@@ -84,8 +84,8 @@ private fun generateResolveAllConfigurationsTask(excludes: List<String>) =
|
|||||||
.matching { it.canBeResolved }
|
.matching { it.canBeResolved }
|
||||||
.matching { !excludeConfigs.contains(it.name) }
|
.matching { !excludeConfigs.contains(it.name) }
|
||||||
.each { configuration ->
|
.each { configuration ->
|
||||||
try {
|
def configurationPath = (project.path == ":") ? ":" + configuration.name : project.path + ":" + configuration.name
|
||||||
def configurationPath = (project.path == ":") ? ":" + configuration.name : project.path + ":" + configuration.name
|
try {
|
||||||
println "Resolving " + configurationPath
|
println "Resolving " + configurationPath
|
||||||
configuration.files.each { println '>> ' + configurationPath + ' --> ' + it.name }
|
configuration.files.each { println '>> ' + configurationPath + ' --> ' + it.name }
|
||||||
println "OK, resolved " + configurationPath + "\n"
|
println "OK, resolved " + configurationPath + "\n"
|
||||||
@@ -136,15 +136,15 @@ private fun generateResolveAllConfigurationsTaskKts(excludes: List<String>) =
|
|||||||
}
|
}
|
||||||
""".trimIndent()
|
""".trimIndent()
|
||||||
private fun computeExcludeConfigurations(excludes: List<String>): String {
|
private fun computeExcludeConfigurations(excludes: List<String>): String {
|
||||||
val deprecatedConfigurations = listOf("compile", "runtime", "compileOnly", "runtimeOnly")
|
val excludingConfigurations = listOf("compile", "runtime", "compileOnly", "runtimeOnly", "dependencySources")
|
||||||
return """
|
return """
|
||||||
sourceSets.forEach { sourceSet ->
|
kotlin.sourceSets.forEach { sourceSet ->
|
||||||
"${deprecatedConfigurations.joinToString()}".split(", ").toList().forEach {
|
"${excludingConfigurations.joinToString()}".split(", ").toList().forEach {
|
||||||
excludeConfigs.add(sourceSet.name + it.capitalize())
|
excludeConfigs.add(sourceSet.name + it.capitalize())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
"${deprecatedConfigurations.joinToString()}".split(", ").toList().forEach {
|
"${excludingConfigurations.joinToString()}".split(", ").toList().forEach {
|
||||||
excludeConfigs.add(it)
|
excludeConfigs.add(it)
|
||||||
excludeConfigs.add("test" + it.capitalize())
|
excludeConfigs.add("test" + it.capitalize())
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user