~ubuntu-branches/debian/sid/scala/sid

« back to all changes in this revision

Viewing changes to src/compiler/scala/tools/nsc/settings/FscSettings.scala

  • Committer: Package Import Robot
  • Author(s): Emmanuel Bourg, Mehdi Dogguy, Lucas Satabin, Frank S. Thomas, Emmanuel Bourg
  • Date: 2015-06-05 23:52:59 UTC
  • mfrom: (1.2.11)
  • Revision ID: package-import@ubuntu.com-20150605235259-wk00vgk83dh8o19g
Tags: 2.10.5-1
* Team upload.

[ Mehdi Dogguy ]
* New upstream release (Closes: #744278).

[ Lucas Satabin ]
* Update patches
* Update the clean target
* Update paths of elements to install
* Update watch file

[ Frank S. Thomas ]
* Remove myself from Uploaders.

[ Emmanuel Bourg ]
* The package has been adopted by the Java Team (Closes: #754935)
* Patched the build to avoid downloading libraries from the Internet
* Replaced the minified JavaScript files with unobfuscated ones
* No longer build scala-partest.jar until diffutils is packaged or replaced
* debian/watch: Fixed the versions matched (x.y.z instead of x.y.z..z)
* debian/rules:
  - Added the missing get-orig-source target (Closes: #724704)
  - Improved the clean target
* debian/control:
  - Build depend on scala (>= 2.10) and bnd
  - Use canonical URLs for the Vcs-* fields
  - Standards-Version updated to 3.9.6 (no changes)
* Switch to debhelper level 9

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* NSC -- new Scala compiler
2
 
 * Copyright 2005-2011 LAMP/EPFL
 
2
 * Copyright 2005-2013 LAMP/EPFL
3
3
 * @author  Paul Phillips
4
4
 */
5
5
 
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)
28
28
 
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
40
40
  )
 
41
  
 
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)})
 
46
  }
 
47
  
 
48
  /**
 
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.
 
51
   */
 
52
  private[this] def absolutizePath(p: String) = (Path(currentDir.value) resolve Path(p)).normalize.path
41
53
 
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 */
 
55
  def absolutize() {
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)
49
60
      case _                => ()
50
61
    }
51
62
  }