Skip to content

Commit

Permalink
refactor(conan): Rename inspectOrNull() to inspectPyFile()
Browse files Browse the repository at this point in the history
Make clear from the name that the type of Conan file plays a role.

Signed-off-by: Sebastian Schuberth <[email protected]>
  • Loading branch information
sschuberth committed Jul 19, 2024
1 parent 012e9cf commit a40ea91
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions plugins/package-managers/conan/src/main/kotlin/Conan.kt
Original file line number Diff line number Diff line change
Expand Up @@ -392,19 +392,19 @@ class Conan(
* from the `requires` field. Need to investigate whether this is a sure thing before implementing.
*/
private fun generateProjectPackage(pkgInfo: PackageInfo, definitionFile: File, workingDir: File): Package {
fun inspectOrNull(field: String) =
fun inspectPyFile(field: String) =
definitionFile.name.takeIf { it == "conanfile.py" }?.let { inspectField(it, workingDir, field) }

return Package(
id = Identifier(
type = managerName,
namespace = "",
name = inspectOrNull("name") ?: pkgInfo.reference.orEmpty(),
version = inspectOrNull("version").orEmpty()
name = inspectPyFile("name") ?: pkgInfo.reference.orEmpty(),
version = inspectPyFile("version").orEmpty()
),
authors = parseAuthors(pkgInfo),
declaredLicenses = pkgInfo.license.toSet(),
description = inspectOrNull("description").orEmpty(),
description = inspectPyFile("description").orEmpty(),
homepageUrl = pkgInfo.homepage.orEmpty(),
binaryArtifact = RemoteArtifact.EMPTY, // TODO: implement me!
sourceArtifact = RemoteArtifact.EMPTY, // TODO: implement me!
Expand Down

0 comments on commit a40ea91

Please sign in to comment.