summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/settings/FscSettings.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2013-01-29 11:23:59 -0800
committerPaul Phillips <paulp@improving.org>2013-01-29 13:10:48 -0800
commit5c00f4137fbc02a6bfcb3eb52d225e26b4373615 (patch)
treefb0fb1c54e213016d8f4bf1fe8b6fd1770ff4760 /src/compiler/scala/tools/nsc/settings/FscSettings.scala
parentf389f6a18f5812a08f324222432ba45a5b15aa18 (diff)
parentd392d56d6bf8b0ae9072b354e4ec68becd0df679 (diff)
downloadscala-5c00f4137fbc02a6bfcb3eb52d225e26b4373615.tar.gz
scala-5c00f4137fbc02a6bfcb3eb52d225e26b4373615.tar.bz2
scala-5c00f4137fbc02a6bfcb3eb52d225e26b4373615.zip
Merge remote-tracking branch 'origin/2.10.x' into pr/merge-210
* commit 'd392d56d6bf8b0ae9072b354e4ec68becd0df679': SI-4602 Disable unreliable test of fsc path absolutization Update a checkfile from a recent fix. SI-7018 Fix memory leak in Attachments. SI-4733 - fsc no longer creates a single temp directory for all users. Bumped partest MaxPermSize to 128m. SI-6891 Fix value class + tailrec crasher. Ill-scoped reference checking in TreeCheckers Make value classes TreeCheckers friendly SI-4602 Make fsc absolutize source file names SI-6863 Fix verify error in captured var inited from expr with try/catch SI-6932 Remove Batchable trait plus minor clean-ups Fix SI-6932 by enabling linearization of callback execution for the internal execution context of Future SI-6443 Expand test coverage with varargs, by-name. SI-6443 Widen dependent param types in uncurry Conflicts: src/reflect/scala/reflect/internal/Trees.scala test/partest
Diffstat (limited to 'src/compiler/scala/tools/nsc/settings/FscSettings.scala')
-rw-r--r--src/compiler/scala/tools/nsc/settings/FscSettings.scala23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/compiler/scala/tools/nsc/settings/FscSettings.scala b/src/compiler/scala/tools/nsc/settings/FscSettings.scala
index 14b398e50a..34c8e8df9a 100644
--- a/src/compiler/scala/tools/nsc/settings/FscSettings.scala
+++ b/src/compiler/scala/tools/nsc/settings/FscSettings.scala
@@ -39,13 +39,24 @@ class FscSettings(error: String => Unit) extends Settings(error) {
d, dependencyfile, pluginsDir, Ygenjavap
)
- /** All user set settings rewritten with absolute paths. */
- def absolutize(root: Path) {
- def rewrite(p: String) = (root resolve Path(p)).normalize.path
+ override def processArguments(arguments: List[String], processAll: Boolean): (Boolean, List[String]) = {
+ val (r, args) = super.processArguments(arguments, processAll)
+ // we need to ensure the files specified with relative locations are absolutized based on the currentDir
+ (r, args map {a => absolutizePath(a)})
+ }
+
+ /**
+ * Take an individual path and if it's not absolute turns it into an absolute path based on currentDir.
+ * If it's already absolute then it's left alone.
+ */
+ private[this] def absolutizePath(p: String) = (Path(currentDir.value) resolve Path(p)).normalize.path
+
+ /** All user set settings rewritten with absolute paths based on currentDir */
+ def absolutize() {
userSetSettings foreach {
- case p: OutputSetting => p.outputDirs setSingleOutput AbstractFile.getDirectory(rewrite(p.value))
- case p: PathSetting => p.value = ClassPath.map(p.value, rewrite)
- case p: StringSetting => if (holdsPath(p)) p.value = rewrite(p.value)
+ case p: OutputSetting => p.outputDirs setSingleOutput AbstractFile.getDirectory(absolutizePath(p.value))
+ case p: PathSetting => p.value = ClassPath.map(p.value, absolutizePath)
+ case p: StringSetting => if (holdsPath(p)) p.value = absolutizePath(p.value)
case _ => ()
}
}