Skip to content

Commit

Permalink
Fix some bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
ianoc committed Mar 5, 2022
1 parent feb117e commit 287e1f0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions src/scala/com/github/johnynek/bazel_deps/GradleResolver.scala
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,19 @@ class GradleResolver(servers: List[DependencyServer], ec: ExecutionContext, runT
case Success(value) => Task.point(value)
case Failure(exception) => Task.fail(exception)
}
}

def resolve(model: Model): Task[(Graph[MavenCoordinate, Unit],
SortedMap[MavenCoordinate, ResolvedShasValue],
Map[UnversionedCoordinate, Set[Edge[MavenCoordinate, Unit]]])] = {
buildGraph(Nil, model)
.flatMap { graph =>
def replaced(m: MavenCoordinate): Boolean =
model.getReplacements.get(m.unversioned).isDefined
for {
shas <- getShas(graph.nodes.filterNot(replaced).toList.sorted)
} yield (graph, shas, Map())
}
}

def run[A](fa: Task[A]): Try[A] = {
Expand Down
2 changes: 1 addition & 1 deletion src/scala/com/github/johnynek/bazel_deps/MakeDeps.scala
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ object MakeDeps {
val ec = scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.duration._
val resolver = new GradleResolver(model.getOptions.getResolvers, ec, 3600.seconds, g)
resolver.run(resolver.buildGraph(Nil, model)).map { g => (g, SortedMap(), Map())}
resolver.run(resolver.resolve(model))
}

private def resolve[F[_]](model: Model,
Expand Down

0 comments on commit 287e1f0

Please sign in to comment.