From 9f2f2e9ccca06f537685f95909ebea55f90d30fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20St=C3=A4ding?= Date: Sun, 29 Oct 2023 23:33:04 +0100 Subject: [PATCH] Fix unclear parameter name normalizedName -> nameOverride in AbstractConfiguration --- .../gradle/extension/AbstractConfiguration.kt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/launcher/gradle-plugin/src/main/kotlin/org/sourcegrade/jagr/gradle/extension/AbstractConfiguration.kt b/launcher/gradle-plugin/src/main/kotlin/org/sourcegrade/jagr/gradle/extension/AbstractConfiguration.kt index b328936d..b43e3e08 100644 --- a/launcher/gradle-plugin/src/main/kotlin/org/sourcegrade/jagr/gradle/extension/AbstractConfiguration.kt +++ b/launcher/gradle-plugin/src/main/kotlin/org/sourcegrade/jagr/gradle/extension/AbstractConfiguration.kt @@ -71,23 +71,23 @@ abstract class AbstractConfiguration( } } - private fun getConfiguration(configurationName: String, normalizedName: String?): Pair>? { + private fun getConfiguration(configurationName: String, nameOverride: String?): Pair>? { return project.configurations.findByName(configurationName)?.let { configuration -> val dependencies = configuration.dependencies.mapTo(mutableSetOf()) { "${it.group}:${it.name}:${it.version}" } .takeIf { it.isNotEmpty() } ?: return null - (normalizedName ?: configurationName) to dependencies + (nameOverride ?: configurationName) to dependencies } } @JvmOverloads - internal fun getAllDependencies(normalizedName: String? = null): Map> { + internal fun getAllDependencies(nameOverride: String? = null): Map> { return sourceSets.flatMap { sourceSet -> setOfNotNull( - getConfiguration(sourceSet.apiConfigurationName, normalizedName?.let { "${it}Api" }), - getConfiguration(sourceSet.compileOnlyConfigurationName, normalizedName?.let { "${it}CompileOnly" }), - getConfiguration(sourceSet.compileOnlyApiConfigurationName, normalizedName?.let { "${it}CompileOnlyApi" }), - getConfiguration(sourceSet.implementationConfigurationName, normalizedName?.let { "${it}Implementation" }), - getConfiguration(sourceSet.runtimeOnlyConfigurationName, normalizedName?.let { "${it}RuntimeOnly" }), + getConfiguration(sourceSet.apiConfigurationName, nameOverride?.let { "${it}Api" }), + getConfiguration(sourceSet.compileOnlyConfigurationName, nameOverride?.let { "${it}CompileOnly" }), + getConfiguration(sourceSet.compileOnlyApiConfigurationName, nameOverride?.let { "${it}CompileOnlyApi" }), + getConfiguration(sourceSet.implementationConfigurationName, nameOverride?.let { "${it}Implementation" }), + getConfiguration(sourceSet.runtimeOnlyConfigurationName, nameOverride?.let { "${it}RuntimeOnly" }), ) }.toMap() }