-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #182 from gslowikowski/scala212-simplified-proposal
Scala 2.12.0-RC1 support.
- Loading branch information
Showing
6 changed files
with
83 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
scalac-scoverage-plugin/src/test/scala/scoverage/ScalaLoggingSupport.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package scoverage | ||
|
||
import java.io.{File, FileNotFoundException} | ||
import java.net.URL | ||
|
||
import scala.collection.mutable.ListBuffer | ||
import scala.tools.nsc.{Settings, Global} | ||
import scala.tools.nsc.plugins.PluginComponent | ||
import scala.tools.nsc.transform.{Transform, TypingTransformers} | ||
|
||
trait ScalaLoggingSupport { | ||
|
||
val scalaLoggingPackageName: String = if (ScoverageCompiler.ShortScalaVersion == "2.10") { | ||
"com.typesafe.scalalogging.slf4j" | ||
} | ||
else { | ||
"com.typesafe.scalalogging" | ||
} | ||
|
||
lazy val scalaLoggingDeps: Seq[File] = { | ||
if (ScoverageCompiler.ShortScalaVersion == "2.10") { | ||
Seq( | ||
findIvyJar("org.slf4j", "slf4j-api", "1.7.7"), | ||
findCrossedIvyJar("com.typesafe.scala-logging", "scala-logging-api", "2.1.2"), | ||
findCrossedIvyJar("com.typesafe.scala-logging", "scala-logging-slf4j", "2.1.2") | ||
) | ||
} | ||
else { | ||
Seq( | ||
findIvyJar("org.slf4j", "slf4j-api", "1.7.21"), | ||
findCrossedIvyJar("com.typesafe.scala-logging", "scala-logging", "3.5.0", "bundle") | ||
) | ||
} | ||
} | ||
|
||
private def findCrossedIvyJar(groupId: String, artifactId: String, version: String, packaging: String = "jar"): File = | ||
findIvyJar(groupId, artifactId + "_" + ScoverageCompiler.ShortScalaVersion, version, packaging) | ||
|
||
private def findIvyJar(groupId: String, artifactId: String, version: String, packaging: String = "jar"): File = { | ||
val userHome = System.getProperty("user.home") | ||
val jarPath = s"$userHome/.ivy2/cache/$groupId/$artifactId/${packaging}s/${artifactId}-${version}.jar" | ||
val file = new File(jarPath) | ||
if (!file.exists) | ||
throw new FileNotFoundException(s"Could not locate [$jarPath].") | ||
file | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters