[Gradle][Minor] Format GranularMetadataTransformation.kt

KT-49933
This commit is contained in:
Sebastian Sellmair
2023-01-18 11:15:31 +01:00
committed by Space Team
parent e498499858
commit afec974df2
@@ -93,11 +93,13 @@ internal sealed class MetadataDependencyResolution(
} }
private typealias ComponentIdentifierKey = String private typealias ComponentIdentifierKey = String
/** /**
* This unique key can be used to lookup various info for related Resolved Dependency * This unique key can be used to lookup various info for related Resolved Dependency
* that gets serialized * that gets serialized
*/ */
private val ComponentIdentifier.uniqueKey get(): ComponentIdentifierKey = private val ComponentIdentifier.uniqueKey
get(): ComponentIdentifierKey =
when (this) { when (this) {
is ProjectComponentIdentifier -> "project ${build.name}$projectPath" is ProjectComponentIdentifier -> "project ${build.name}$projectPath"
is ModuleComponentIdentifier -> "module $group:$module:$version" is ModuleComponentIdentifier -> "module $group:$module:$version"
@@ -322,7 +324,10 @@ internal class GranularMetadataTransformation(
params.projectData[componentId.projectPath]?.moduleId?.get() params.projectData[componentId.projectPath]?.moduleId?.get()
?: error("Cant find project Module ID by ${componentId.projectPath}") ?: error("Cant find project Module ID by ${componentId.projectPath}")
} else { } else {
ModuleDependencyIdentifier(component.moduleVersion?.group ?: "unspecified", component.moduleVersion?.name ?: "unspecified") ModuleDependencyIdentifier(
component.moduleVersion?.group ?: "unspecified",
component.moduleVersion?.name ?: "unspecified"
)
} }
} }
@@ -332,7 +337,8 @@ internal class GranularMetadataTransformation(
} }
internal val ResolvedComponentResult.currentBuildProjectIdOrNull get(): ProjectComponentIdentifier? { internal val ResolvedComponentResult.currentBuildProjectIdOrNull
get(): ProjectComponentIdentifier? {
val identifier = id val identifier = id
return when { return when {
identifier is ProjectComponentIdentifier && identifier.build.isCurrentBuild -> identifier identifier is ProjectComponentIdentifier && identifier.build.isCurrentBuild -> identifier
@@ -368,5 +374,5 @@ private val KotlinMultiplatformExtension.platformCompilationSourceSets: Set<Stri
internal val GranularMetadataTransformation?.metadataDependencyResolutionsOrEmpty get() = this?.metadataDependencyResolutions ?: emptyList() internal val GranularMetadataTransformation?.metadataDependencyResolutionsOrEmpty get() = this?.metadataDependencyResolutions ?: emptyList()
internal val AttributeContainer.containsMultiplatformAttributes: Boolean get() = internal val AttributeContainer.containsMultiplatformAttributes: Boolean
keySet().any { it.name == KotlinPlatformType.attribute.name } get() = keySet().any { it.name == KotlinPlatformType.attribute.name }