diff --git a/launch/src/main/scala/xsbt/boot/ServerApplication.scala b/launch/src/main/scala/xsbt/boot/ServerApplication.scala index 343b37185..b1d90fe38 100644 --- a/launch/src/main/scala/xsbt/boot/ServerApplication.scala +++ b/launch/src/main/scala/xsbt/boot/ServerApplication.scala @@ -101,6 +101,7 @@ class StreamDumper(in: java.io.BufferedReader, out: java.io.PrintStream) extends case null => () case line => out.println(line) + out.flush() read() } read() @@ -112,7 +113,7 @@ class StreamDumper(in: java.io.BufferedReader, out: java.io.PrintStream) extends // just wait a couple seconds to read more stuff if there is // any stuff. if (waitForErrors) { - endTime.set(System.currentTimeMillis + 2000) + endTime.set(System.currentTimeMillis + 5000) // at this point we'd rather the dumper thread run // before we check whether to sleep Thread.`yield`() @@ -132,7 +133,8 @@ object ServerLauncher { case None => throw new RuntimeException("Logic Failure: Attempting to start a server that isn't configured to be a server. Please report a bug.") } val launchConfig = java.io.File.createTempFile("sbtlaunch", "config") - launchConfig.deleteOnExit() + if (System.getenv("SBT_SERVER_SAVE_TEMPS") eq null) + launchConfig.deleteOnExit() LaunchConfiguration.save(config, launchConfig) val jvmArgs: List[String] = serverConfig.jvmArgs map readLines match { case Some(args) => args diff --git a/project/Sbt.scala b/project/Sbt.scala index 0af48a1d2..48e3dc07b 100644 --- a/project/Sbt.scala +++ b/project/Sbt.scala @@ -29,7 +29,7 @@ object Sbt extends Build { javacOptions in compile ++= Seq("-target", "6", "-source", "6", "-Xlint", "-Xlint:-serial"), incOptions := incOptions.value.withNameHashing(true), commands += Command.command("setupBuildScala211") { state => - """set scalaVersion in ThisBuild := "2.11.0" """ :: + """set scalaVersion in ThisBuild := "2.11.1" """ :: "set Util.includeTestDependencies in ThisBuild := true" :: state }, @@ -48,12 +48,12 @@ object Sbt extends Build { // TODO - To some extent these should take args to figure out what to do. commands += Command.command("release-libs-211") { state => "setupBuildScala211" :: - /// First test - lameAgregateTask("test") :: - // Note: You need the sbt-pgp plugin installed to release. - lameAgregateTask("publishSigned") :: - // Now restore the defaults. - "reload" :: state + /// First test + lameAgregateTask("test") :: + // Note: You need the sbt-pgp plugin installed to release. + lameAgregateTask("publishSigned") :: + // Now restore the defaults. + "reload" :: state }, commands += Command.command("release-sbt-local") { state => "publishLocal" :: diff --git a/util/classpath/src/main/scala/sbt/classpath/ClassLoaderCache.scala b/util/classpath/src/main/scala/sbt/classpath/ClassLoaderCache.scala index 3886fe4d5..2e489eb6f 100644 --- a/util/classpath/src/main/scala/sbt/classpath/ClassLoaderCache.scala +++ b/util/classpath/src/main/scala/sbt/classpath/ClassLoaderCache.scala @@ -5,6 +5,7 @@ import java.io.File import java.net.URLClassLoader import java.util.HashMap +// Hack for testing only private[sbt] final class ClassLoaderCache(val commonParent: ClassLoader) { private[this] val delegate = new HashMap[List[File], Reference[CachedClassLoader]] @@ -25,9 +26,9 @@ private[sbt] final class ClassLoaderCache(val commonParent: ClassLoader) { get(files, stamps, existingRef.get) private[this] def get(files: List[File], stamps: List[Long], existing: CachedClassLoader): ClassLoader = - if (existing == null || stamps != existing.timestamps) + if (existing == null || stamps != existing.timestamps) { newEntry(files, stamps) - else + } else existing.loader private[this] def newEntry(files: List[File], stamps: List[Long]): ClassLoader = diff --git a/util/classpath/src/test/scala/sbt/classpath/ConcurrentCache.scala b/util/classpath/src/test/scala/sbt/classpath/ConcurrentCache.scala deleted file mode 100644 index ab2fa9ac9..000000000 --- a/util/classpath/src/test/scala/sbt/classpath/ConcurrentCache.scala +++ /dev/null @@ -1,30 +0,0 @@ -package sbt -package classpath - -import org.scalacheck._ -import Prop._ -import java.io.File - -object ConcurrentCache extends Properties("ClassLoaderCache concurrent access") { - implicit lazy val concurrentArb: Arbitrary[Int] = Arbitrary(Gen.choose(1, 1000)) - implicit lazy val filenameArb: Arbitrary[String] = Arbitrary(Gen.alphaStr) - - property("Same class loader for same classpaths concurrently processed") = forAll { (names: List[String], concurrent: Int) => - withcp(names.distinct) { files => - val cache = new ClassLoaderCache(null) - val loaders = (1 to concurrent).par.map(_ => cache(files)).toList - sameClassLoader(loaders) - } - } - - private[this] def withcp[T](names: List[String])(f: List[File] => T): T = IO.withTemporaryDirectory { tmp => - val files = names.map { name => - val file = new File(tmp, name) - IO.touch(file) - file - } - f(files) - } - private[this] def sameClassLoader(loaders: Seq[ClassLoader]): Boolean = loaders.size < 2 || - loaders.sliding(2).forall { case Seq(x, y) => x == y } -} \ No newline at end of file