Skip to content

Commit

Permalink
refactor(pub): Extract constants for the scope names
Browse files Browse the repository at this point in the history
Prepare for an upcoming change.

Signed-off-by: Frank Viernau <frank_viernau@epam.com>
  • Loading branch information
fviernau committed Sep 2, 2024
1 parent 01a200e commit 2401bf2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions plugins/package-managers/pub/src/main/kotlin/Pub.kt
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,13 @@ private const val DEFAULT_FLUTTER_VERSION = "3.19.3-stable"
private const val DEFAULT_GRADLE_VERSION = "7.3"
private const val PUBSPEC_YAML = "pubspec.yaml"
private const val PUB_LOCK_FILE = "pubspec.lock"
private const val SCOPE_NAME_DEPENDENCIES = "dependencies"
private const val SCOPE_NAME_DEV_DEPENDENCIES = "dev_dependencies"

private val flutterCommand = if (Os.isWindows) "flutter.bat" else "flutter"
private val dartCommand = if (Os.isWindows) "dart.bat" else "dart"


/**
* The [Pub](https://pub.dev/) package manager for Dart / Flutter.
*
Expand Down Expand Up @@ -313,9 +316,9 @@ class Pub(

logger.info { "Successfully parsed installed packages." }

scopes += parseScope("dependencies", manifest, lockfile, parsePackagesResult.packages, labels, workingDir)
scopes += parseScope(SCOPE_NAME_DEPENDENCIES, manifest, lockfile, parsePackagesResult.packages, labels, workingDir)
scopes += parseScope(
"dev_dependencies", manifest, lockfile, parsePackagesResult.packages, labels, workingDir
SCOPE_NAME_DEV_DEPENDENCIES, manifest, lockfile, parsePackagesResult.packages, labels, workingDir
)
}

Expand Down

0 comments on commit 2401bf2

Please sign in to comment.