Normalize line endings.

This commit is contained in:
cheeseng 2013-04-04 10:39:29 +08:00
parent 5df0deacf0
commit df9a475158
21 changed files with 219 additions and 219 deletions

View File

@ -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

View File

@ -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 {
}

View File

@ -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;
}

View File

@ -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.")
}
}

View File

@ -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

View File

@ -1,4 +1,4 @@
k1 := {error("k1")}
k2 <<= k1 map identity
k1 := {error("k1")}
k2 <<= k1 map identity

View File

@ -1,4 +1,4 @@
k1 := {}
k2 <<= k1 map identity
k1 := {}
k2 <<= k1 map identity

View File

@ -1,6 +1,6 @@
k1 := {}
k2 := {}
k1 <<= k1 map {_ => error("k1")}
k1 := {}
k2 := {}
k1 <<= k1 map {_ => error("k1")}

View File

@ -1,6 +1,6 @@
k1 := {
}
k2 := {
}
k1 := {
}
k2 := {
}

View File

@ -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("."))
}

View File

@ -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

View File

@ -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.
}

View File

@ -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
}

View File

@ -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 = ""
}

View File

@ -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
}

View File

@ -1,4 +1,4 @@
class B {
def foo = 1
def bar(a: A) {}
}
class B {
def foo = 1
def bar(a: A) {}
}

View File

@ -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")
}

View File

@ -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)
}
}

View File

@ -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()
}
}

View File

@ -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

View File

@ -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
}