aboutsummaryrefslogtreecommitdiff
path: root/compiler/test/dotty/Jars.scala
diff options
context:
space:
mode:
authorFelix Mulder <felix.mulder@gmail.com>2017-04-05 19:22:58 +0200
committerFelix Mulder <felix.mulder@gmail.com>2017-04-12 11:31:13 +0200
commitc1e787f7560807ca95e021d9cb7f1406c5953c3c (patch)
tree75d2d3e93f89d19f5113a10287a739512f9a7d7a /compiler/test/dotty/Jars.scala
parent923533ea86b53b90e343e4fc0f88956996a2ed5b (diff)
downloaddotty-c1e787f7560807ca95e021d9cb7f1406c5953c3c.tar.gz
dotty-c1e787f7560807ca95e021d9cb7f1406c5953c3c.tar.bz2
dotty-c1e787f7560807ca95e021d9cb7f1406c5953c3c.zip
Make inter JVM communication be string based
Diffstat (limited to 'compiler/test/dotty/Jars.scala')
-rw-r--r--compiler/test/dotty/Jars.scala13
1 files changed, 13 insertions, 0 deletions
diff --git a/compiler/test/dotty/Jars.scala b/compiler/test/dotty/Jars.scala
index f062f8b25..06df9c891 100644
--- a/compiler/test/dotty/Jars.scala
+++ b/compiler/test/dotty/Jars.scala
@@ -19,4 +19,17 @@ object Jars {
val dottyTestDeps: List[String] =
dottyLib :: dottyCompiler :: dottyInterfaces :: dottyExtras
+
+
+ def scalaLibraryFromRuntime: String = findJarFromRuntime("scala-library-2.")
+
+ private def findJarFromRuntime(partialName: String) = {
+ val urls = ClassLoader.getSystemClassLoader.asInstanceOf[java.net.URLClassLoader].getURLs.map(_.getFile.toString)
+ urls.find(_.contains(partialName)).getOrElse {
+ throw new java.io.FileNotFoundException(
+ s"""Unable to locate $partialName on classpath:\n${urls.toList.mkString("\n")}"""
+ )
+ }
+ }
+
}