diff --git a/sbt/src/sbt-test/actions/reload/test b/sbt/src/sbt-test/actions/reload/test index ef1be05a7..69e42a70f 100755 --- a/sbt/src/sbt-test/actions/reload/test +++ b/sbt/src/sbt-test/actions/reload/test @@ -1,13 +1,13 @@ --> f -> project sub -> f -> reload -> f -$ copy-file changes/Changed.scala project/TestProject.scala -> reload --> f -> project {external}root2 -> g -# The current URI should be kept -> reload +-> f +> project sub +> f +> reload +> f +$ copy-file changes/Changed.scala project/TestProject.scala +> reload +-> f +> project {external}root2 +> g +# The current URI should be kept +> reload > g \ No newline at end of file diff --git a/sbt/src/sbt-test/api/basic/src/main/scala/testCase/JFoo.java b/sbt/src/sbt-test/api/basic/src/main/scala/testCase/JFoo.java index ec3f0e35d..e849d8df7 100755 --- a/sbt/src/sbt-test/api/basic/src/main/scala/testCase/JFoo.java +++ b/sbt/src/sbt-test/api/basic/src/main/scala/testCase/JFoo.java @@ -1,10 +1,10 @@ -package testCase; - -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; - - -@Retention(RetentionPolicy.RUNTIME) -public @interface JFoo { - -} +package testCase; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + + +@Retention(RetentionPolicy.RUNTIME) +public @interface JFoo { + +} diff --git a/sbt/src/sbt-test/api/basic/src/main/scala/testCase/annotations.scala b/sbt/src/sbt-test/api/basic/src/main/scala/testCase/annotations.scala index dcce55d75..c74c28494 100644 --- a/sbt/src/sbt-test/api/basic/src/main/scala/testCase/annotations.scala +++ b/sbt/src/sbt-test/api/basic/src/main/scala/testCase/annotations.scala @@ -1,7 +1,7 @@ - -import annotation.target.field - - -package object testCase { - type Foo = JFoo @field; -} + +import annotation.target.field + + +package object testCase { + type Foo = JFoo @field; +} diff --git a/sbt/src/sbt-test/dependency-management/force/project/TestProject.scala b/sbt/src/sbt-test/dependency-management/force/project/TestProject.scala index d0d13403c..8a6bc5d1a 100755 --- a/sbt/src/sbt-test/dependency-management/force/project/TestProject.scala +++ b/sbt/src/sbt-test/dependency-management/force/project/TestProject.scala @@ -1,26 +1,26 @@ -import sbt._ -import Keys._ - -object TestProject extends Build -{ - lazy val root = Project("root", file(".")) settings( - ivyPaths <<= (baseDirectory, target)( (dir, t) => new IvyPaths(dir, Some(t / "ivy-cache"))), - libraryDependencies <++= baseDirectory (libraryDeps), - TaskKey[Unit]("check-forced") <<= check("1.2.14"), - TaskKey[Unit]("check-depend") <<= check("1.2.13") - ) - - def libraryDeps(base: File) = { - val slf4j = Seq("org.slf4j" % "slf4j-log4j12" % "1.1.0") // Uses log4j 1.2.13 - if ((base / "force").exists) slf4j :+ ("log4j" % "log4j" % "1.2.14" force()) else slf4j - } - - def check(ver: String) = - (dependencyClasspath in Compile) map { jars => - val log4j = jars map (_.data) collect { - case f if f.getName contains "log4j-" => f.getName - } - if (log4j.size != 1 || !log4j.head.contains(ver)) - error("Did not download the correct jar.") - } -} +import sbt._ +import Keys._ + +object TestProject extends Build +{ + lazy val root = Project("root", file(".")) settings( + ivyPaths <<= (baseDirectory, target)( (dir, t) => new IvyPaths(dir, Some(t / "ivy-cache"))), + libraryDependencies <++= baseDirectory (libraryDeps), + TaskKey[Unit]("check-forced") <<= check("1.2.14"), + TaskKey[Unit]("check-depend") <<= check("1.2.13") + ) + + def libraryDeps(base: File) = { + val slf4j = Seq("org.slf4j" % "slf4j-log4j12" % "1.1.0") // Uses log4j 1.2.13 + if ((base / "force").exists) slf4j :+ ("log4j" % "log4j" % "1.2.14" force()) else slf4j + } + + def check(ver: String) = + (dependencyClasspath in Compile) map { jars => + val log4j = jars map (_.data) collect { + case f if f.getName contains "log4j-" => f.getName + } + if (log4j.size != 1 || !log4j.head.contains(ver)) + error("Did not download the correct jar.") + } +} diff --git a/sbt/src/sbt-test/dependency-management/force/test b/sbt/src/sbt-test/dependency-management/force/test index 314b98fd7..2cb44cea7 100755 --- a/sbt/src/sbt-test/dependency-management/force/test +++ b/sbt/src/sbt-test/dependency-management/force/test @@ -1,12 +1,12 @@ -$ touch force - -> reload - -> check-forced --> check-depend - -$ delete force -> reload - --> check-forced +$ touch force + +> reload + +> check-forced +-> check-depend + +$ delete force +> reload + +-> check-forced > check-depend \ No newline at end of file diff --git a/sbt/src/sbt-test/project/session-save/build.check.1 b/sbt/src/sbt-test/project/session-save/build.check.1 index 1e25d0391..f1dd6431d 100755 --- a/sbt/src/sbt-test/project/session-save/build.check.1 +++ b/sbt/src/sbt-test/project/session-save/build.check.1 @@ -1,4 +1,4 @@ -k1 := {error("k1")} - -k2 <<= k1 map identity - +k1 := {error("k1")} + +k2 <<= k1 map identity + diff --git a/sbt/src/sbt-test/project/session-save/build.check.2 b/sbt/src/sbt-test/project/session-save/build.check.2 index 42c414288..2bb4dc49d 100755 --- a/sbt/src/sbt-test/project/session-save/build.check.2 +++ b/sbt/src/sbt-test/project/session-save/build.check.2 @@ -1,4 +1,4 @@ -k1 := {} - -k2 <<= k1 map identity - +k1 := {} + +k2 <<= k1 map identity + diff --git a/sbt/src/sbt-test/project/session-save/build.check.3 b/sbt/src/sbt-test/project/session-save/build.check.3 index ad18cca9f..0c0b932c5 100755 --- a/sbt/src/sbt-test/project/session-save/build.check.3 +++ b/sbt/src/sbt-test/project/session-save/build.check.3 @@ -1,6 +1,6 @@ -k1 := {} - -k2 := {} - -k1 <<= k1 map {_ => error("k1")} - +k1 := {} + +k2 := {} + +k1 <<= k1 map {_ => error("k1")} + diff --git a/sbt/src/sbt-test/project/session-save/build.sbt b/sbt/src/sbt-test/project/session-save/build.sbt index fcf95068c..d0208fa47 100755 --- a/sbt/src/sbt-test/project/session-save/build.sbt +++ b/sbt/src/sbt-test/project/session-save/build.sbt @@ -1,6 +1,6 @@ -k1 := { -} - -k2 := { -} - +k1 := { +} + +k2 := { +} + diff --git a/sbt/src/sbt-test/project/session-save/project/Build.scala b/sbt/src/sbt-test/project/session-save/project/Build.scala index d90a26779..b7ba35d2f 100755 --- a/sbt/src/sbt-test/project/session-save/project/Build.scala +++ b/sbt/src/sbt-test/project/session-save/project/Build.scala @@ -1,8 +1,8 @@ -import sbt._ - -object TestBuild extends Build { - val k1 = TaskKey[Unit]("k1") - val k2 = TaskKey[Unit]("k2") - - lazy val root = Project("root", file(".")) -} +import sbt._ + +object TestBuild extends Build { + val k1 = TaskKey[Unit]("k1") + val k2 = TaskKey[Unit]("k2") + + lazy val root = Project("root", file(".")) +} diff --git a/sbt/src/sbt-test/project/session-save/test b/sbt/src/sbt-test/project/session-save/test index c552f3a31..58f8a7b46 100755 --- a/sbt/src/sbt-test/project/session-save/test +++ b/sbt/src/sbt-test/project/session-save/test @@ -1,25 +1,25 @@ -> set k1 := {error("k1")} -> session save -> reload --> k1 - -> set k2 <<= k1 map identity -> session save -> reload --> k2 -$ must-mirror build.sbt build.check.1 - -> set k1 := {} -> session save -> reload -> k1 -> k2 -$ must-mirror build.sbt build.check.2 - -> set k1 <<= k1 map {_ => error("k1")} -> set k2 := {} -> session save -> reload --> k1 -> k2 +> set k1 := {error("k1")} +> session save +> reload +-> k1 + +> set k2 <<= k1 map identity +> session save +> reload +-> k2 +$ must-mirror build.sbt build.check.1 + +> set k1 := {} +> session save +> reload +> k1 +> k2 +$ must-mirror build.sbt build.check.2 + +> set k1 <<= k1 map {_ => error("k1")} +> set k2 := {} +> session save +> reload +-> k1 +> k2 $ must-mirror build.sbt build.check.3 \ No newline at end of file diff --git a/sbt/src/sbt-test/tests/test-quick/changed/A.scala b/sbt/src/sbt-test/tests/test-quick/changed/A.scala index 869db8f1c..6eecd055c 100755 --- a/sbt/src/sbt-test/tests/test-quick/changed/A.scala +++ b/sbt/src/sbt-test/tests/test-quick/changed/A.scala @@ -1,4 +1,4 @@ -case class A(b: B) { - def foo = b.foo - // A comment added should trigger recompilation. +case class A(b: B) { + def foo = b.foo + // A comment added should trigger recompilation. } \ No newline at end of file diff --git a/sbt/src/sbt-test/tests/test-quick/changed/B.scala b/sbt/src/sbt-test/tests/test-quick/changed/B.scala index 0fcd03a98..e81be16d9 100755 --- a/sbt/src/sbt-test/tests/test-quick/changed/B.scala +++ b/sbt/src/sbt-test/tests/test-quick/changed/B.scala @@ -1,5 +1,5 @@ -class B { - def foo = 1 - // API-level change - def bar(a: A) = 2 -} +class B { + def foo = 1 + // API-level change + def bar(a: A) = 2 +} diff --git a/sbt/src/sbt-test/tests/test-quick/changed/Base.scala b/sbt/src/sbt-test/tests/test-quick/changed/Base.scala index c569ca19e..492839a88 100755 --- a/sbt/src/sbt-test/tests/test-quick/changed/Base.scala +++ b/sbt/src/sbt-test/tests/test-quick/changed/Base.scala @@ -1,7 +1,7 @@ -import java.io.File - -trait Base { - val marker = new File("marker") - // Test compilation group change. - val baz = "" -} +import java.io.File + +trait Base { + val marker = new File("marker") + // Test compilation group change. + val baz = "" +} diff --git a/sbt/src/sbt-test/tests/test-quick/src/main/scala/A.scala b/sbt/src/sbt-test/tests/test-quick/src/main/scala/A.scala index 6e5bc52de..9b76dea09 100755 --- a/sbt/src/sbt-test/tests/test-quick/src/main/scala/A.scala +++ b/sbt/src/sbt-test/tests/test-quick/src/main/scala/A.scala @@ -1,4 +1,4 @@ -// A, B are referring to each other, OK in the same compilation group. -case class A(b: B) { - def foo = b.foo +// A, B are referring to each other, OK in the same compilation group. +case class A(b: B) { + def foo = b.foo } \ No newline at end of file diff --git a/sbt/src/sbt-test/tests/test-quick/src/main/scala/B.scala b/sbt/src/sbt-test/tests/test-quick/src/main/scala/B.scala index 43be25453..4f4c91fcf 100755 --- a/sbt/src/sbt-test/tests/test-quick/src/main/scala/B.scala +++ b/sbt/src/sbt-test/tests/test-quick/src/main/scala/B.scala @@ -1,4 +1,4 @@ -class B { - def foo = 1 - def bar(a: A) {} -} +class B { + def foo = 1 + def bar(a: A) {} +} diff --git a/sbt/src/sbt-test/tests/test-quick/src/test/scala/Base.scala b/sbt/src/sbt-test/tests/test-quick/src/test/scala/Base.scala index 5604f26bd..e32283600 100755 --- a/sbt/src/sbt-test/tests/test-quick/src/test/scala/Base.scala +++ b/sbt/src/sbt-test/tests/test-quick/src/test/scala/Base.scala @@ -1,5 +1,5 @@ -import java.io.File - -trait Base { - val marker = new File("marker") -} +import java.io.File + +trait Base { + val marker = new File("marker") +} diff --git a/sbt/src/sbt-test/tests/test-quick/src/test/scala/Create.scala b/sbt/src/sbt-test/tests/test-quick/src/test/scala/Create.scala index 24dc57ea2..121de95b0 100755 --- a/sbt/src/sbt-test/tests/test-quick/src/test/scala/Create.scala +++ b/sbt/src/sbt-test/tests/test-quick/src/test/scala/Create.scala @@ -1,11 +1,11 @@ -import org.scalatest.FlatSpec -import org.scalatest.matchers.ShouldMatchers - -class Create extends FlatSpec with ShouldMatchers with Base { - "a file" should "not exist" in { - A(new B).foo - marker.exists should equal(false) - marker.createNewFile() should equal (true) - } - -} +import org.scalatest.FlatSpec +import org.scalatest.matchers.ShouldMatchers + +class Create extends FlatSpec with ShouldMatchers with Base { + "a file" should "not exist" in { + A(new B).foo + marker.exists should equal(false) + marker.createNewFile() should equal (true) + } + +} diff --git a/sbt/src/sbt-test/tests/test-quick/src/test/scala/Delete.scala b/sbt/src/sbt-test/tests/test-quick/src/test/scala/Delete.scala index 6bd113901..cd2eb6617 100755 --- a/sbt/src/sbt-test/tests/test-quick/src/test/scala/Delete.scala +++ b/sbt/src/sbt-test/tests/test-quick/src/test/scala/Delete.scala @@ -1,10 +1,10 @@ -import org.scalatest.FlatSpec -import org.scalatest.matchers.ShouldMatchers - -class Delete extends FlatSpec with ShouldMatchers with Base { - "a file" should "exist" in { - marker.exists should equal(true) - marker.delete() - } - -} +import org.scalatest.FlatSpec +import org.scalatest.matchers.ShouldMatchers + +class Delete extends FlatSpec with ShouldMatchers with Base { + "a file" should "exist" in { + marker.exists should equal(true) + marker.delete() + } + +} diff --git a/sbt/src/sbt-test/tests/test-quick/test b/sbt/src/sbt-test/tests/test-quick/test index dec97baa0..865e74a5a 100755 --- a/sbt/src/sbt-test/tests/test-quick/test +++ b/sbt/src/sbt-test/tests/test-quick/test @@ -1,34 +1,34 @@ -> test-quick Create -# Create not re-run, Delete deletes the file. -> test-quick -# Re-create the file. -> test-only Create - -# Non-API change -$ copy-file changed/A.scala src/main/scala/A.scala -> compile -$ sleep 2000 -# Create is run. Delete is not since it doesn't have src/main dependency. --> test-quick -> test-only Delete -# Previous run of Create failed, re-run. -> test-quick Create -# No-op. -> test-quick Create -# API change. - -$ copy-file changed/B.scala src/main/scala/B.scala -> compile -$ sleep 2000 --> test-quick Create -> test-only Delete -# Previous run of Create failed, re-run. -> test-quick Create -# src/test compilation group change. - -$ copy-file changed/Base.scala src/test/scala/Base.scala -> test:compile -$ sleep 2000 --> test-quick Create -> test-quick Delete +> test-quick Create +# Create not re-run, Delete deletes the file. +> test-quick +# Re-create the file. +> test-only Create + +# Non-API change +$ copy-file changed/A.scala src/main/scala/A.scala +> compile +$ sleep 2000 +# Create is run. Delete is not since it doesn't have src/main dependency. +-> test-quick +> test-only Delete +# Previous run of Create failed, re-run. +> test-quick Create +# No-op. +> test-quick Create +# API change. + +$ copy-file changed/B.scala src/main/scala/B.scala +> compile +$ sleep 2000 +-> test-quick Create +> test-only Delete +# Previous run of Create failed, re-run. +> test-quick Create +# src/test compilation group change. + +$ copy-file changed/Base.scala src/test/scala/Base.scala +> test:compile +$ sleep 2000 +-> test-quick Create +> test-quick Delete > test-quick Create \ No newline at end of file diff --git a/util/collection/src/main/scala/sbt/Positions.scala b/util/collection/src/main/scala/sbt/Positions.scala index b2aa22ee2..f52c583b0 100755 --- a/util/collection/src/main/scala/sbt/Positions.scala +++ b/util/collection/src/main/scala/sbt/Positions.scala @@ -1,20 +1,20 @@ -package sbt - -sealed trait SourcePosition - -sealed trait FilePosition extends SourcePosition { - def path: String - def startLine: Int -} - -case object NoPosition extends SourcePosition - -final case class LinePosition(path: String, startLine: Int) extends FilePosition - -final case class LineRange(start: Int, end: Int) { - def shift(n: Int) = new LineRange(start + n, end + n) -} - -final case class RangePosition(path: String, range: LineRange) extends FilePosition { - def startLine = range.start -} +package sbt + +sealed trait SourcePosition + +sealed trait FilePosition extends SourcePosition { + def path: String + def startLine: Int +} + +case object NoPosition extends SourcePosition + +final case class LinePosition(path: String, startLine: Int) extends FilePosition + +final case class LineRange(start: Int, end: Int) { + def shift(n: Int) = new LineRange(start + n, end + n) +} + +final case class RangePosition(path: String, range: LineRange) extends FilePosition { + def startLine = range.start +}