diff options
author | Felix Mulder <felix.mulder@gmail.com> | 2017-04-05 19:22:58 +0200 |
---|---|---|
committer | Felix Mulder <felix.mulder@gmail.com> | 2017-04-12 11:31:13 +0200 |
commit | c1e787f7560807ca95e021d9cb7f1406c5953c3c (patch) | |
tree | 75d2d3e93f89d19f5113a10287a739512f9a7d7a /compiler/test/dotty/Jars.scala | |
parent | 923533ea86b53b90e343e4fc0f88956996a2ed5b (diff) | |
download | dotty-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.scala | 13 |
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")}""" + ) + } + } + } |