Skip to content

Commit

Permalink
refactor(Pub): Rename GRADLE_VERSION to DEFAULT_GRADLE_VERSION
Browse files Browse the repository at this point in the history
Rename the constant to make the purpose clearer.

Signed-off-by: Martin Nonnenmacher <[email protected]>
  • Loading branch information
mnonnenmacher committed Jun 7, 2024
1 parent 42fd409 commit 2ffb557
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plugins/package-managers/pub/src/main/kotlin/Pub.kt
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ import org.ossreviewtoolkit.utils.ort.showStackTrace
import org.semver4j.RangesList
import org.semver4j.RangesListFactory

private const val GRADLE_VERSION = "7.3"
private const val DEFAULT_GRADLE_VERSION = "7.3"
private const val PUBSPEC_YAML = "pubspec.yaml"
private const val PUB_LOCK_FILE = "pubspec.lock"

Expand All @@ -94,7 +94,7 @@ private val dartCommand = if (Os.isWindows) "dart.bat" else "dart"
* This package manager supports the following [options][PackageManagerConfiguration.options]:
* - *flutterVersion*: The version to use when bootstrapping Flutter. If Flutter is already on the path, this option is
* ignored.
* - *gradleVersion*: The version of Gradle to use when analyzing Gradle projects. Defaults to [GRADLE_VERSION].
* - *gradleVersion*: The version of Gradle to use when analyzing Gradle projects. Defaults to [DEFAULT_GRADLE_VERSION].
* - *pubDependenciesOnly*: Only scan Pub dependencies and skip native ones for Android (Gradle) and iOS (CocoaPods).
*/
@Suppress("TooManyFunctions")
Expand Down Expand Up @@ -444,7 +444,7 @@ class Pub(
if (gradleFactory == null || !definitionFile.isFile) return emptyList()

return analyzerResultCacheAndroid.getOrPut(packageName) {
val pubGradleVersion = options[OPTION_GRADLE_VERSION] ?: GRADLE_VERSION
val pubGradleVersion = options[OPTION_GRADLE_VERSION] ?: DEFAULT_GRADLE_VERSION

logger.info {
"Analyzing Android dependencies for package '$packageName' using Gradle version $pubGradleVersion."
Expand Down

0 comments on commit 2ffb557

Please sign in to comment.