Skip to content

Commit

Permalink
docs(spm): Improve the KDoc for resolveLibraryDependencies()
Browse files Browse the repository at this point in the history
Swift Package Manager definition files may be used for both,
applications and libraries. So, remove the misleading bits of the
comment in that regard.

Furthermore, it's not true that this function should only be used when
`allowDynamicVersions` is set, because `Package.swift` may have a
sibling lockfile which pins the versions. So, remove that part of the
comment.

Note that `Spm.kt` should be improved to only analyze the lockfiles
directly in case there is no sibling `Package.swift` file.

Signed-off-by: Frank Viernau <frank_viernau@epam.com>
  • Loading branch information
fviernau committed Jan 19, 2024
1 parent a3b09cc commit b169d6b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions plugins/package-managers/spm/src/main/kotlin/Spm.kt
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,9 @@ class Spm(
}

/**
* Resolves dependencies when the final build target is a library and Package.swift is available.
* Resolves dependencies of a `Package.swift` file.
* This method parses dependencies from `swift package show-dependencies --format json` output.
* Also, this method provides parent-child associations for parsed dependencies.
*
* Only used when analyzerConfig.allowDynamicVersions is set to true.
*/
private fun resolveLibraryDependencies(definitionFile: File): List<ProjectAnalyzerResult> {
val project = projectFromDefinitionFile(definitionFile)
Expand Down

0 comments on commit b169d6b

Please sign in to comment.