Skip to content

Commit

Permalink
Move locks
Browse files Browse the repository at this point in the history
  • Loading branch information
tindzk committed Jan 27, 2019
1 parent bdafb01 commit 9990725
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/main/scala/seed/artefact/Coursier.scala
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ object Coursier {
def resolve(all: Set[Dep], resolvers: Resolvers, ivyPath: Path, cachePath: Path): Resolution =
if (all.isEmpty) Resolution.empty
else {
lock.lock()

val organisations = all.map(_.organisation).toList.sorted.map(Ansi.italic).mkString(", ")
Log.debug(s"Resolving ${Ansi.bold(all.size.toString)} dependencies from $organisations...")

Expand Down Expand Up @@ -93,7 +91,6 @@ object Coursier {
sys.exit(1)
}

lock.unlock()
resolution
}

Expand Down Expand Up @@ -121,12 +118,16 @@ object Coursier {
ivyPath: Path,
cachePath: Path,
optionalArtefacts: Boolean): ResolutionResult = {
lock.lock()
val resolution = resolve(deps, resolvers, ivyPath, cachePath)
val artefacts = resolution.dependencyArtifacts(
Some(overrideClassifiers(
sources = optionalArtefacts,
javaDoc = optionalArtefacts))).map(_._3).toList
ResolutionResult(resolution, localArtefacts(artefacts, cachePath))

val result = ResolutionResult(resolution, localArtefacts(artefacts, cachePath))
lock.unlock()
result
}

def resolveSubset(resolution: Resolution,
Expand Down

0 comments on commit 9990725

Please sign in to comment.