Skip to content

Commit

Permalink
refactor(swiftpm): Turn a property into a function
Browse files Browse the repository at this point in the history
Make the code within the file consistent in this regard.

Signed-off-by: Frank Viernau <frank_viernau@epam.com>
  • Loading branch information
fviernau committed Feb 7, 2024
1 parent 70a350e commit 9e71678
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions plugins/package-managers/swiftpm/src/main/kotlin/SwiftPm.kt
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ class SwiftPm(
}
}

private val SwiftPackage.id: Identifier
get() = Identifier(
private fun SwiftPackage.toId(): Identifier =
Identifier(
type = PACKAGE_TYPE,
namespace = "",
name = getCanonicalName(url),
Expand All @@ -178,11 +178,11 @@ private fun SwiftPackage.toVcsInfo(): VcsInfo {
return vcsInfoFromUrl.takeUnless { it.revision.isBlank() } ?: vcsInfoFromUrl.copy(revision = version)
}

private fun SwiftPackage.toPackage(): Package = createPackage(id, toVcsInfo())
private fun SwiftPackage.toPackage(): Package = createPackage(toId(), toVcsInfo())

private fun SwiftPackage.toPackageReference(): PackageReference =
PackageReference(
id = id,
id = toId(),
dependencies = dependencies.mapTo(mutableSetOf()) { it.toPackageReference() }
)

Expand Down

0 comments on commit 9e71678

Please sign in to comment.