@@ -3,8 +3,6 @@ package scoverage
3
3
import java .io .{File , FileNotFoundException }
4
4
import java .net .URL
5
5
6
- import scoverage .ScoverageCompiler .getScalaJsJars
7
-
8
6
import scala .collection .mutable .ListBuffer
9
7
import scala .tools .nsc .{Settings , Global }
10
8
import scala .tools .nsc .plugins .PluginComponent
@@ -19,8 +17,8 @@ object ScoverageCompiler {
19
17
case _ => ScalaVersion
20
18
}
21
19
22
- def classPath = ( getScalaJars ++ getScalaJsJars ++ List (sbtCompileDir, runtimeClasses)).map(_. getAbsolutePath)
23
-
20
+ def classPath = getScalaJars.map(_.getAbsolutePath) :+ sbtCompileDir.getAbsolutePath :+ runtimeClasses. getAbsolutePath
21
+
24
22
def settings : Settings = {
25
23
val s = new scala.tools.nsc.Settings
26
24
s.Xprint .value = List (" all" , " _" )
@@ -50,11 +48,6 @@ object ScoverageCompiler {
50
48
scalaJars.map(findScalaJar)
51
49
}
52
50
53
- private def getScalaJsJars : List [File ] = {
54
- val scalaJars = List (" scalajs-library" )
55
- scalaJars.map(findScalaJsJar)
56
- }
57
-
58
51
private def sbtCompileDir : File = {
59
52
val dir = new File (s " ./scalac-scoverage-plugin/target/scala- $ShortScalaVersion/classes " )
60
53
if (! dir.exists)
@@ -66,8 +59,6 @@ object ScoverageCompiler {
66
59
67
60
private def findScalaJar (artifactId : String ): File = findIvyJar(" org.scala-lang" , artifactId, ScalaVersion )
68
61
69
- private def findScalaJsJar (artifactId : String ): File = findIvyJar(s " org.scala-js " , s " ${artifactId}_ ${ShortScalaVersion }" , " 0.6.28" )
70
-
71
62
private def findIvyJar (groupId : String , artifactId : String , version : String , packaging : String = " jar" ): File = {
72
63
val userHome = System .getProperty(" user.home" )
73
64
val jarPath = s " $userHome/.ivy2/cache/ $groupId/ $artifactId/ ${packaging}s/ $artifactId- $version.jar "
@@ -84,6 +75,8 @@ class ScoverageCompiler(settings: scala.tools.nsc.Settings, rep: scala.tools.nsc
84
75
def addToClassPath (file : File ): Unit = {
85
76
settings.classpath.value = settings.classpath.value + File .pathSeparator + file.getAbsolutePath
86
77
}
78
+
79
+ addToClassPath(ScoverageCompiler .findIvyJar(s " org.scala-js " , s " scalajs-library_ ${ScoverageCompiler .ShortScalaVersion }" , " 0.6.28" ))
87
80
88
81
val instrumentationComponent = new ScoverageInstrumentationComponent (this , None , None )
89
82
instrumentationComponent.setOptions(new ScoverageOptions ())
0 commit comments