@@ -10,7 +10,7 @@ import scala.collection.mutable.ListBuffer
10
10
/** @author Stephen Samuel */
11
11
trait PluginSupport {
12
12
13
- val scalaVersion = " 2.10.3 "
13
+ val scalaVersion = " 2.10.4 "
14
14
val shortScalaVersion = " 2.10"
15
15
16
16
val settings = new scala.tools.nsc.Settings
@@ -26,6 +26,7 @@ trait PluginSupport {
26
26
def writeCodeSnippetToTempFile (code : String ): File = {
27
27
val file = File .createTempFile(" scoverage_snippet" , " .scala" )
28
28
org.apache.commons.io.FileUtils .write(file, code)
29
+ file.deleteOnExit()
29
30
file
30
31
}
31
32
@@ -44,24 +45,21 @@ trait PluginSupport {
44
45
}
45
46
46
47
def getScalaJars : List [File ] = {
47
- val scalaJars = List (" scala-compiler.jar " , " scala-library.jar " , " scala-reflect.jar " )
48
+ val scalaJars = List (" scala-compiler" , " scala-library" , " scala-reflect" )
48
49
scalaJars.map(findScalaJar)
49
50
}
50
51
51
- def findScalaJar (jarName : String ): File = {
52
- val userHome = System .getProperty(" user.home" )
53
- val sbtHome = userHome + " /.sbt"
54
- val sbtScalaLibs = sbtHome + " /boot/scala-" + scalaVersion + " /lib"
55
- val file = new File (sbtScalaLibs + " /" + jarName)
56
- if (file.exists) file else throw new FileNotFoundException (s " Could not locate [ $jarName]. Tests require SBT 0.13+ " )
57
- }
52
+ def findScalaJar (artifactId : String ): File = findIvyJar(" org.scala-lang" , artifactId, scalaVersion)
58
53
59
54
def findIvyJar (groupId : String , artifactId : String , version : String ): File = {
60
55
val userHome = System .getProperty(" user.home" )
61
56
val sbtHome = userHome + " /.ivy2"
62
57
val jarPath = sbtHome + " /cache/" + groupId + " /" + artifactId + " /jars/" + artifactId + " -" + version + " .jar"
63
58
val file = new File (jarPath)
64
- if (file.exists) file else throw new FileNotFoundException (s " Could not locate [ $jarPath]. Tests require SBT 0.13+ " )
59
+ if (file.exists) {
60
+ println(s " Located ivy jar [ $file] " )
61
+ file
62
+ } else throw new FileNotFoundException (s " Could not locate [ $jarPath]. Tests require SBT 0.13+ " )
65
63
}
66
64
67
65
def sbtCompileDir : File = {
@@ -93,7 +91,7 @@ class ScoverageAwareCompiler(settings: scala.tools.nsc.Settings, reporter: scala
93
91
val sources = new ListBuffer [String ]
94
92
95
93
override val phaseName : String = " scoverage-teststore"
96
- override val runsAfter : List [String ] = List (" dce" )
94
+ override val runsAfter : List [String ] = List (" dce" ) // deadcode
97
95
override val runsBefore = List [String ](" terminal" )
98
96
99
97
override protected def newTransformer (unit : global.CompilationUnit ): global.Transformer = new Transformer (unit)
0 commit comments