improved error message in case of non existing configuration
This commit is contained in:
@@ -58,9 +58,18 @@ object DependencyExporter {
|
|||||||
var sequence = 0
|
var sequence = 0
|
||||||
val map = HashMap<ResolvedComponentResult, Int>()
|
val map = HashMap<ResolvedComponentResult, Int>()
|
||||||
|
|
||||||
val resolutionResult = project.configurations.single {
|
val requestedConfiguration = project.configurations.singleOrNull {
|
||||||
it.name == ext.configurationName
|
it.name == ext.configurationName
|
||||||
}.incoming.resolutionResult
|
}?.takeIf { it.isCanBeResolved } ?: let {
|
||||||
|
val resolvableConfigurations = "[" + project.configurations.asSequence()
|
||||||
|
.filter { it.isCanBeResolved }
|
||||||
|
.map { "'${it.name}'" }
|
||||||
|
.joinToString(",") + "]"
|
||||||
|
throw GradleException("Configuration '${ext.configurationName}' doesn't exist or cannot be resolved, " +
|
||||||
|
"resolvable configurations in this project are " + resolvableConfigurations)
|
||||||
|
}
|
||||||
|
|
||||||
|
val resolutionResult = requestedConfiguration.incoming.resolutionResult
|
||||||
if (!ext.outputFile.isAbsolute) {
|
if (!ext.outputFile.isAbsolute) {
|
||||||
ext.outputFile = project.buildDir.toPath().resolve(ext.outputFile)
|
ext.outputFile = project.buildDir.toPath().resolve(ext.outputFile)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user