24
24
val server = StringSetting ("-server", "hostname:portnumber", "Specify compile server socket", "")
25
25
val preferIPv4 = BooleanSetting("-ipv4", "Use IPv4 rather than IPv6 for the server socket")
26
26
val idleMins = IntSetting ("-max-idle", "Set idle timeout in minutes for fsc (use 0 for no timeout)",
27
30, Some(0, Int.MaxValue), (_: String) => None)
27
30, Some((0, Int.MaxValue)), (_: String) => None)
29
29
// For improved help output, separating fsc options from the others.
30
30
def fscSpecific = Set[Settings#Setting](
38
38
private def holdsPath = Set[Settings#Setting](
39
39
d, dependencyfile, pluginsDir, Ygenjavap
42
override def processArguments(arguments: List[String], processAll: Boolean): (Boolean, List[String]) = {
43
val (r, args) = super.processArguments(arguments, processAll)
44
// we need to ensure the files specified with relative locations are absolutized based on the currentDir
45
(r, args map {a => absolutizePath(a)})
49
* Take an individual path and if it's not absolute turns it into an absolute path based on currentDir.
50
* If it's already absolute then it's left alone.
52
private[this] def absolutizePath(p: String) = (Path(currentDir.value) resolve Path(p)).normalize.path
42
/** All user set settings rewritten with absolute paths. */
43
def absolutize(root: Path) {
44
def rewrite(p: String) = (root resolve Path(p)).normalize.path
54
/** All user set settings rewritten with absolute paths based on currentDir */
45
56
userSetSettings foreach {
46
case p: OutputSetting => p.outputDirs setSingleOutput AbstractFile.getDirectory(rewrite(p.value))
47
case p: PathSetting => p.value = ClassPath.map(p.value, rewrite)
48
case p: StringSetting => if (holdsPath(p)) p.value = rewrite(p.value)
57
case p: OutputSetting => p.outputDirs setSingleOutput AbstractFile.getDirectory(absolutizePath(p.value))
58
case p: PathSetting => p.value = ClassPath.map(p.value, absolutizePath)
59
case p: StringSetting => if (holdsPath(p)) p.value = absolutizePath(p.value)