diff --git a/plugins/package-managers/cocoapods/src/main/kotlin/CocoaPods.kt b/plugins/package-managers/cocoapods/src/main/kotlin/CocoaPods.kt index 48037818a4ee4..8165b3260db54 100644 --- a/plugins/package-managers/cocoapods/src/main/kotlin/CocoaPods.kt +++ b/plugins/package-managers/cocoapods/src/main/kotlin/CocoaPods.kt @@ -159,11 +159,11 @@ class CocoaPods( private fun getPackage(id: Identifier, workingDir: File): Package { val podspec = getPodspec(id, workingDir) ?: return Package.EMPTY.copy(id = id, purl = id.toPurl()) - val vcs = podspec.source["git"]?.let { url -> + val vcs = podspec.source?.git?.let { url -> VcsInfo( type = VcsType.GIT, url = url, - revision = podspec.source["tag"].orEmpty() + revision = podspec.source.tag.orEmpty() ) }.orEmpty() @@ -174,7 +174,7 @@ class CocoaPods( description = podspec.summary, homepageUrl = podspec.homepage, binaryArtifact = RemoteArtifact.EMPTY, - sourceArtifact = podspec.source["http"]?.let { RemoteArtifact(it, Hash.NONE) }.orEmpty(), + sourceArtifact = podspec.source?.http?.let { RemoteArtifact(it, Hash.NONE) }.orEmpty(), vcs = vcs, vcsProcessed = processPackageVcs(vcs, podspec.homepage) ) diff --git a/plugins/package-managers/cocoapods/src/main/kotlin/Podspec.kt b/plugins/package-managers/cocoapods/src/main/kotlin/Podspec.kt index c6d58a817c071..7a3af02ea9bce 100644 --- a/plugins/package-managers/cocoapods/src/main/kotlin/Podspec.kt +++ b/plugins/package-managers/cocoapods/src/main/kotlin/Podspec.kt @@ -38,9 +38,16 @@ internal data class Podspec( val license: String = "", val summary: String = "", val homepage: String = "", - val source: Map = emptyMap(), + val source: Source? = null, private val subspecs: List = emptyList() ) { + @JsonIgnoreProperties(ignoreUnknown = true) + data class Source( + val git: String? = null, + val tag: String? = null, + val http: String? = null + ) + fun withSubspecs(): List { val result = mutableListOf()