File tree Expand file tree Collapse file tree 3 files changed +5
-19
lines changed Expand file tree Collapse file tree 3 files changed +5
-19
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ import java.net.URL
9
9
import scala .tools .util .PathResolverFactory
10
10
11
11
class GenericRunnerSettings (error : String => Unit ) extends Settings (error) {
12
- def classpathURLs : Seq [URL ] = PathResolverFactory .create(this ).resultAsURLs
12
+ lazy val classpathURLs : Seq [URL ] = PathResolverFactory .create(this ).resultAsURLs
13
13
14
14
val howtorun =
15
15
ChoiceSetting (
Original file line number Diff line number Diff line change @@ -22,13 +22,9 @@ trait ScalaSettings extends AbsScalaSettings
22
22
/** Set of settings */
23
23
protected [scala] lazy val allSettings = mutable.HashSet [Setting ]()
24
24
25
- /** Against my better judgment, giving in to martin here and allowing
26
- * CLASSPATH to be used automatically. So for the user-specified part
27
- * of the classpath:
28
- *
29
- * - If -classpath or -cp is given, it is that
30
- * - Otherwise, if CLASSPATH is set, it is that
31
- * - If neither of those, then "." is used.
25
+ /** The user class path, specified by `-classpath` or `-cp`,
26
+ * defaults to the value of CLASSPATH env var if it is set, as in Java,
27
+ * or else to `"."` for the current user directory.
32
28
*/
33
29
protected def defaultClasspath = sys.env.getOrElse(" CLASSPATH" , " ." )
34
30
Original file line number Diff line number Diff line change @@ -254,17 +254,7 @@ abstract class PathResolverBase[BaseClassPathType <: ClassFileLookup[AbstractFil
254
254
* TODO: we should refactor this as a separate -bootstrap option to have a clean implementation, no? */
255
255
def sourcePath = if (! settings.isScaladoc) cmdLineOrElse(" sourcepath" , Defaults .scalaSourcePath) else " "
256
256
257
- /** Against my better judgment, giving in to martin here and allowing
258
- * CLASSPATH to be used automatically. So for the user-specified part
259
- * of the classpath:
260
- *
261
- * - If -classpath or -cp is given, it is that
262
- * - Otherwise, if CLASSPATH is set, it is that
263
- * - If neither of those, then "." is used.
264
- */
265
- def userClassPath =
266
- if (! settings.classpath.isDefault) settings.classpath.value
267
- else sys.env.getOrElse(" CLASSPATH" , " ." )
257
+ def userClassPath = settings.classpath.value // default is specified by settings and can be overridden there
268
258
269
259
import classPathFactory ._
270
260
You can’t perform that action at this time.
0 commit comments