summaryrefslogtreecommitdiff
path: root/project/ShaResolve.scala
diff options
context:
space:
mode:
authorJosh Suereth <joshua.suereth@gmail.com>2011-12-14 17:42:00 -0500
committerJosh Suereth <joshua.suereth@gmail.com>2011-12-14 17:42:00 -0500
commit2f150c026785854b47132335fe44347dd16d0427 (patch)
treed90befc62e656c73683f09becd88da2ddfe048a8 /project/ShaResolve.scala
parent981a9a028cfdae3198687b6591f8d9c2732ef0a8 (diff)
parent249be0ce81c89302b06aa3ed6444aa5bd55659db (diff)
downloadscala-2f150c026785854b47132335fe44347dd16d0427.tar.gz
scala-2f150c026785854b47132335fe44347dd16d0427.tar.bz2
scala-2f150c026785854b47132335fe44347dd16d0427.zip
Merge branch 'xsbt' of github.com:scala/scala into xsbt
Diffstat (limited to 'project/ShaResolve.scala')
-rw-r--r--project/ShaResolve.scala13
1 files changed, 10 insertions, 3 deletions
diff --git a/project/ShaResolve.scala b/project/ShaResolve.scala
index c6034bbf01..5cc99fd9cf 100644
--- a/project/ShaResolve.scala
+++ b/project/ShaResolve.scala
@@ -4,7 +4,7 @@ import Build._
import Keys._
import Project.Initialize
import scala.collection.{ mutable, immutable }
-
+import scala.collection.parallel.CompositeThrowable
@@ -22,17 +22,24 @@ object ShaResolve {
pullBinaryLibs in ThisBuild <<= (baseDirectory, binaryLibCache, streams) map resolveLibs
)
- def resolveLibs(dir: File, cacheDir: File, s: TaskStreams): Unit = {
+ def resolveLibs(dir: File, cacheDir: File, s: TaskStreams): Unit = loggingParallelExceptions(s) {
val files = (dir / "test" / "files" ** "*.desired.sha1") +++ (dir / "lib" ** "*.desired.sha1")
for {
(file, name) <- (files x relativeTo(dir)).par
- uri = name.dropRight(13)
+ uri = name.dropRight(13).replace('\\', '/')
jar = dir / uri
if !jar.exists || !isValidSha(file)
sha = getShaFromShafile(file)
} pullFile(jar, sha + "/" + uri, cacheDir, s)
}
+ @inline final def loggingParallelExceptions[U](s: TaskStreams)(f: => U): U = try f catch {
+ case t: CompositeThrowable =>
+ s.log.error("Error during parallel execution, GET READ FOR STACK TRACES!!")
+ t.throwables foreach (t2 => s.log.trace(t2))
+ throw t
+ }
+
def getShaFromShafile(file: File): String = (IO read file split "\\s" headOption) getOrElse error("No SHA found for " + file)