diff --git a/plugins/package-managers/pub/src/main/kotlin/Pub.kt b/plugins/package-managers/pub/src/main/kotlin/Pub.kt index 83e8e904dacd1..4d34d40215fbc 100644 --- a/plugins/package-managers/pub/src/main/kotlin/Pub.kt +++ b/plugins/package-managers/pub/src/main/kotlin/Pub.kt @@ -378,7 +378,7 @@ class Pub( if (pkgInfoFromLockfile == null || pkgInfoFromLockfile.source == "sdk") return@forEach val id = Identifier( - type = "Pub", + type = if (pkgInfoFromLockfile.isProject) projectType else "Pub", namespace = "", name = packageName, version = pkgInfoFromLockfile.version.orEmpty() @@ -629,7 +629,7 @@ class Pub( } val id = Identifier( - type = "Pub", + type = if (packageInfo.isProject) projectType else "Pub", namespace = "", name = rawName, version = version @@ -773,6 +773,9 @@ class Pub( PackageManagerResult(projectResults.filterProjectPackages()) } +private val PackageInfo.isProject: Boolean + get() = source == "path" && description.url == null + /** * Extract information about package authors from the given [pubspec]. */