Skip to content

Commit d18c822

Browse files
fviernausschuberth
authored andcommitted
feat(cocoapods): Improve handling for dependencies with checkout option
The information of podspecs corresponding to dependencies which have a checkout option has been ignored so far. Unify the code paths, so that the information from podspecs is always used. This simplifies the code and might get additional data, such as declared licenses and the source artifact url. Furthermore, the VCS URL from the checkout option is no more used as `homepageUrl`, but instead always set to the dedicated `homepage` field of the podspec. This is more consistent with integration of other package managers. Signed-off-by: Frank Viernau <[email protected]>
1 parent fac0ce5 commit d18c822

File tree

3 files changed

+3
-19
lines changed

3 files changed

+3
-19
lines changed

plugins/package-managers/cocoapods/src/funTest/assets/projects/synthetic/external-sources-expected-output.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ packages:
206206
declared_licenses: []
207207
declared_licenses_processed: {}
208208
description: ""
209-
homepage_url: "https://github.com/MacLabs/MLHudAlert.git"
209+
homepage_url: ""
210210
binary_artifact:
211211
url: ""
212212
hash:

plugins/package-managers/cocoapods/src/funTest/assets/projects/synthetic/version-resolution-expected-output.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ packages:
332332
declared_licenses: []
333333
declared_licenses_processed: {}
334334
description: ""
335-
homepage_url: "https://github.com/matrix-org/matrix-analytics-events.git"
335+
homepage_url: ""
336336
binary_artifact:
337337
url: ""
338338
hash:

plugins/package-managers/cocoapods/src/main/kotlin/PodDependencyHandler.kt

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -73,25 +73,9 @@ internal class PodDependencyHandler : DependencyHandler<Lockfile.Pod> {
7373

7474
override fun createPackage(dependency: Lockfile.Pod, issues: MutableCollection<Issue>): Package {
7575
val id = identifierFor(dependency)
76-
7776
val checkoutOption = lockfile.checkoutOptions[dependency.name]
78-
if (checkoutOption != null) {
79-
val vcs = checkoutOption.toVcsInfo()
80-
81-
return Package(
82-
id = id,
83-
declaredLicenses = emptySet(),
84-
description = "",
85-
homepageUrl = vcs.url,
86-
binaryArtifact = RemoteArtifact.EMPTY,
87-
sourceArtifact = RemoteArtifact.EMPTY,
88-
vcs = checkoutOption.toVcsInfo()
89-
)
90-
}
91-
9277
val podspec = getPodspec(dependency.name, dependency.version)
93-
94-
val vcs = podspec?.toVcsInfo().orEmpty()
78+
val vcs = checkoutOption?.toVcsInfo() ?: podspec?.toVcsInfo().orEmpty()
9579

9680
return Package(
9781
id = id,

0 commit comments

Comments
 (0)