Skip to content

Commit

Permalink
Use Order[Dependency]
Browse files Browse the repository at this point in the history
  • Loading branch information
fthomas committed Jan 10, 2025
1 parent 47b2e13 commit 89ecf3a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.*
Expand Down Expand Up @@ -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 =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 89ecf3a

Please sign in to comment.