diff --git a/modules/core/src/main/scala/org/scalasteward/core/buildtool/gradle/gradleParser.scala b/modules/core/src/main/scala/org/scalasteward/core/buildtool/gradle/gradleParser.scala index 130798ce1..89dd81f70 100644 --- a/modules/core/src/main/scala/org/scalasteward/core/buildtool/gradle/gradleParser.scala +++ b/modules/core/src/main/scala/org/scalasteward/core/buildtool/gradle/gradleParser.scala @@ -16,6 +16,7 @@ package org.scalasteward.core.buildtool.gradle +import cats.implicits.* import org.scalasteward.core.data.{ArtifactId, Dependency, GroupId, Version} import org.tomlj.{Toml, TomlTable} import scala.jdk.CollectionConverters.* @@ -43,7 +44,7 @@ object gradleParser { case _ => None } .toList - .sortBy(d => (d.groupId.value, d.artifactId.name, d.version.value)) + .sorted private def parseDependency(lib: TomlTable, versions: TomlTable): Option[Dependency] = parseVersion(lib, versions).flatMap { version => diff --git a/modules/core/src/test/scala/org/scalasteward/core/buildtool/gradle/GradleAlgTest.scala b/modules/core/src/test/scala/org/scalasteward/core/buildtool/gradle/GradleAlgTest.scala index ce50468ce..af4f5accf 100644 --- a/modules/core/src/test/scala/org/scalasteward/core/buildtool/gradle/GradleAlgTest.scala +++ b/modules/core/src/test/scala/org/scalasteward/core/buildtool/gradle/GradleAlgTest.scala @@ -22,14 +22,11 @@ class GradleAlgTest extends CatsEffectSuite { |""".stripMargin ) val obtained = initial.flatMap(gradleAlg.getDependencies(buildRoot).runA) + val kotlinJvm = + "org.jetbrains.kotlin.jvm".g % "org.jetbrains.kotlin.jvm.gradle.plugin".a % "2.1.20-Beta1" val expected = List( List("org.tomlj".g % "tomlj".a % "1.1.1").withMavenCentral, - Scope( - List( - "org.jetbrains.kotlin.jvm".g % "org.jetbrains.kotlin.jvm.gradle.plugin".a % "2.1.20-Beta1" - ), - List(GradleAlg.pluginsResolver) - ) + Scope(List(kotlinJvm), List(GradleAlg.pluginsResolver)) ) assertIO(obtained, expected) }