From 53a7b8f07ac0c549d5332f4b3b08255d6a4e8b5b Mon Sep 17 00:00:00 2001 From: Martin Nonnenmacher Date: Fri, 7 Jun 2024 11:43:09 +0200 Subject: [PATCH] refactor(pub): Add a constant for the default Flutter version Signed-off-by: Martin Nonnenmacher --- plugins/package-managers/pub/src/main/kotlin/Pub.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/package-managers/pub/src/main/kotlin/Pub.kt b/plugins/package-managers/pub/src/main/kotlin/Pub.kt index 42c782946d7b8..ca403d223462f 100644 --- a/plugins/package-managers/pub/src/main/kotlin/Pub.kt +++ b/plugins/package-managers/pub/src/main/kotlin/Pub.kt @@ -76,6 +76,7 @@ import org.ossreviewtoolkit.utils.ort.showStackTrace import org.semver4j.RangesList import org.semver4j.RangesListFactory +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" @@ -120,7 +121,7 @@ class Pub( ) = Pub(type, analysisRoot, analyzerConfig, repoConfig) } - private val flutterVersion = options[OPTION_FLUTTER_VERSION] ?: Os.env["FLUTTER_VERSION"] ?: "3.19.3-stable" + private val flutterVersion = options[OPTION_FLUTTER_VERSION] ?: Os.env["FLUTTER_VERSION"] ?: DEFAULT_FLUTTER_VERSION private val flutterInstallDir = ortToolsDirectory.resolve("flutter-$flutterVersion") private val flutterHome by lazy {