From 399d507abd76603585ba9f7021fa46a5ced40945 Mon Sep 17 00:00:00 2001 From: Frank Viernau Date: Thu, 5 Sep 2024 10:19:47 +0200 Subject: [PATCH] refactor(pub): Inline some variables in `parseProject()` Signed-off-by: Frank Viernau --- plugins/package-managers/pub/src/main/kotlin/Pub.kt | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/plugins/package-managers/pub/src/main/kotlin/Pub.kt b/plugins/package-managers/pub/src/main/kotlin/Pub.kt index c121f7e505cf9..3bb11d25266f5 100644 --- a/plugins/package-managers/pub/src/main/kotlin/Pub.kt +++ b/plugins/package-managers/pub/src/main/kotlin/Pub.kt @@ -491,22 +491,18 @@ class Pub( private fun parseProject(definitionFile: File, pubspec: Pubspec, scopes: Set): Project { // See https://dart.dev/tools/pub/pubspec for supported fields. - val rawName = pubspec.name val homepageUrl = pubspec.homepage.orEmpty() - val repositoryUrl = pubspec.repository.orEmpty() - val authors = parseAuthors(pubspec) - - val vcs = VcsHost.parseUrl(repositoryUrl) + val vcs = VcsHost.parseUrl(pubspec.repository.orEmpty()) return Project( id = Identifier( type = managerName, namespace = "", - name = rawName, + name = pubspec.name, version = pubspec.version.orEmpty() ), definitionFilePath = VersionControlSystem.getPathInfo(definitionFile).path, - authors = authors, + authors = parseAuthors(pubspec), // Pub does not declare any licenses in the pubspec files, therefore we keep this empty. declaredLicenses = emptySet(), vcs = vcs,