Skip to content
Snippets Groups Projects
Verified Commit cfd351c9 authored by Rico Bergmann's avatar Rico Bergmann
Browse files

[WIP] Adapt classpath based on OS

parent e8a236da
No related branches found
No related tags found
2 merge requests!2Publish v0.1,!1Move away from experimental changes
This commit is part of merge request !1. Comments created here will be created in the context of that merge request.
......@@ -13,8 +13,7 @@ import scala.tools.nsc.reporters.ConsoleReporter
import scala.tools.nsc.{ GenericRunnerSettings, Global, Settings }
import scala.util.control.Breaks._
/**
* @author Rico Bergmann
/** @author Rico Bergmann
*/
class SModelFSWriter extends SModelVisitor {
......@@ -138,14 +137,24 @@ class SModelFSWriter extends SModelVisitor {
}
private def adaptClassPathToOSEnv(cp: List[String]): List[String] = {
// TODO adapt for UNIX systems (only works on windows right now)
sys.props("os.name").toLowerCase match {
case win if win contains "windows" =>
cp.map(entry => {
val UrlRegex = """file:/(.*)""".r
val WinUrl = """file:/(.*)""".r
entry match {
case UrlRegex(path) => path
case WinUrl(path) => path
case p => p
}
}).map(_.replaceAll("/", "\\\\").replaceAll("%20", " "))
case unix =>
val UnixUrl = """file:(.*)""".r
cp.map(entry => {
entry match {
case UnixUrl(path) => path
case p => p
}
})
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment