Skip to content

Commit

Permalink
refactor(pub): Inline some variables in parseProject()
Browse files Browse the repository at this point in the history
Signed-off-by: Frank Viernau <frank_viernau@epam.com>
  • Loading branch information
fviernau committed Sep 5, 2024
1 parent f5b8f6d commit 399d507
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions plugins/package-managers/pub/src/main/kotlin/Pub.kt
Original file line number Diff line number Diff line change
Expand Up @@ -491,22 +491,18 @@ class Pub(

private fun parseProject(definitionFile: File, pubspec: Pubspec, scopes: Set<Scope>): 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,
Expand Down

0 comments on commit 399d507

Please sign in to comment.