Skip to content

Commit

Permalink
Don't add non-existing resources to dependency classpath
Browse files Browse the repository at this point in the history
  • Loading branch information
jvican committed Jan 15, 2019
1 parent 301d3e5 commit 7b296a3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions frontend/src/main/scala/bloop/data/Project.scala
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,13 @@ final case class Project(
// Add the resources right before the classes directory if found in the classpath
Dag.dfs(dag).foreach { p =>
val index = cp.indexOf(p.classesDir)
// If there is an anomaly and the classes dir of a dependency is missing, add resource at end
// Only add those resources that exist at the moment of creating the classpath
val resources = p.resources.filter(_.exists)
if (index == -1) {
cp.appendAll(p.resources)
// If anomaly and classes dir of a dependency is missing, add resources at end
cp.appendAll(resources)
} else {
cp.insertAll(index, p.resources)
cp.insertAll(index, resources)
}
}
cp.toArray
Expand Down

0 comments on commit 7b296a3

Please sign in to comment.