Skip to content

Commit

Permalink
refactor(cocoapods): Use a more speaking name for externalSources
Browse files Browse the repository at this point in the history
Signed-off-by: Frank Viernau <[email protected]>
  • Loading branch information
fviernau committed Jul 16, 2024
1 parent ed9ce11 commit 5d6827c
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class CocoaPods(

scopes += Scope(SCOPE_NAME, lockfileData.dependencies)
packages += scopes.flatMap { it.collectDependencies() }.map {
lockfileData.externalSources[it] ?: getPackage(it, workingDir)
lockfileData.packagesFromCheckoutOptionsForId[it] ?: getPackage(it, workingDir)
}
} else {
issues += createAndLogIssue(
Expand Down Expand Up @@ -221,7 +221,7 @@ private const val SCOPE_NAME = "dependencies"

private data class LockfileData(
val dependencies: Set<PackageReference>,
val externalSources: Map<Identifier, Package>
val packagesFromCheckoutOptionsForId: Map<Identifier, Package>
)

private fun parseLockfile(podfileLock: File): LockfileData {
Expand All @@ -242,7 +242,7 @@ private fun parseLockfile(podfileLock: File): LockfileData {
}
}

val externalSources = lockfile.checkoutOptions.mapNotNull { (name, checkoutOption) ->
val packagesFromCheckoutOptionsForId = lockfile.checkoutOptions.mapNotNull { (name, checkoutOption) ->
val url = checkoutOption.git ?: return@mapNotNull null
val revision = checkoutOption.commit.orEmpty()

Expand Down Expand Up @@ -285,5 +285,5 @@ private fun parseLockfile(podfileLock: File): LockfileData {
createPackageReference(dependency.name)
}

return LockfileData(dependencies, externalSources)
return LockfileData(dependencies, packagesFromCheckoutOptionsForId)
}

0 comments on commit 5d6827c

Please sign in to comment.