Last active
September 16, 2015 01:31
-
-
Save retronym/556c3c3e9aa98cc3357d to your computer and use it in GitHub Desktop.
embeddedDefaults vs URLClasspath scanning
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sbt.version=0.13.8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scalaVersion := "2.11.7" | |
libraryDependencies += "org.scala-lang.modules" %% "scala-async" % "0.9.5" | |
libraryDependencies += "org.scala-lang" % "scala-compiler" % scalaVersion.value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% sbt "set fork in run := false" run | |
[info] Loading global plugins from /Users/jason/.sbt/0.13/plugins | |
[info] Loading project definition from /Users/jason/code/scratch1/project | |
[info] Set current project to scratch1 (in build file:/Users/jason/code/scratch1/) | |
[info] Defining *:run::fork | |
[info] The new value will be used by compile:run::runner, test:run::runner | |
[info] Reapplying settings... | |
[info] Set current project to scratch1 (in build file:/Users/jason/code/scratch1/) | |
[info] Running Test | |
u.getURLs = /Users/jason/code/scratch1/target/scala-2.11/classes:/Users/jason/.ivy2/cache/org.scala-lang/scala-compiler/jars/scala-compiler-2.11.7.jar:/Users/jason/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.11.7.jar:/Users/jason/.ivy2/cache/org.scala-lang/scala-reflect/jars/scala-reflect-2.11.7.jar:/Users/jason/.ivy2/cache/org.scala-lang.modules/scala-xml_2.11/bundles/scala-xml_2.11-1.0.4.jar:/Users/jason/.ivy2/cache/org.scala-lang.modules/scala-parser-combinators_2.11/bundles/scala-parser-combinators_2.11-1.0.4.jar:/Users/jason/.ivy2/cache/org.scala-lang.modules/scala-async_2.11/bundles/scala-async_2.11-0.9.5.jar | |
embeddedDefaults | |
- classpath: /Users/jason/code/scratch1/target/scala-2.11/classes:/Users/jason/.ivy2/cache/org.scala-lang/scala-compiler/jars/scala-compiler-2.11.7.jar:/Users/jason/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.11.7.jar:/Users/jason/.ivy2/cache/org.scala-lang/scala-reflect/jars/scala-reflect-2.11.7.jar:/Users/jason/.ivy2/cache/org.scala-lang.modules/scala-xml_2.11/bundles/scala-xml_2.11-1.0.4.jar:/Users/jason/.ivy2/cache/org.scala-lang.modules/scala-parser-combinators_2.11/bundles/scala-parser-combinators_2.11-1.0.4.jar:/Users/jason/.ivy2/cache/org.scala-lang.modules/scala-async_2.11/bundles/scala-async_2.11-0.9.5.jar | |
- bootclasspath: /Users/jason/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.11.7.jar:/Users/jason/.ivy2/cache/org.scala-lang/scala-compiler/jars/scala-compiler-2.11.7.jar:/Users/jason/.ivy2/cache/org.scala-lang/scala-reflect/jars/scala-reflect-2.11.7.jar:/Users/jason/.ivy2/cache/org.scala-lang.modules/scala-xml_2.11/bundles/scala-xml_2.11-1.0.4.jar:/Users/jason/.ivy2/cache/org.scala-lang.modules/scala-parser-combinators_2.11/bundles/scala-parser-combinators_2.11-1.0.4.jar:/Users/jason/.ivy2/cache/jline/jline/jars/jline-2.12.1.jar | |
[success] Total time: 1 s, completed 16/09/2015 11:30:16 AM | |
⚡ sbt "set fork in run := true" run | |
[info] Loading global plugins from /Users/jason/.sbt/0.13/plugins | |
[info] Loading project definition from /Users/jason/code/scratch1/project | |
[info] Set current project to scratch1 (in build file:/Users/jason/code/scratch1/) | |
[info] Defining *:run::fork | |
[info] The new value will be used by compile:run::runner, test:run::runner | |
[info] Reapplying settings... | |
[info] Set current project to scratch1 (in build file:/Users/jason/code/scratch1/) | |
[info] Running Test | |
[info] u.getURLs = /Users/jason/code/scratch1/target/scala-2.11/classes:/Users/jason/.ivy2/cache/org.scala-lang/scala-compiler/jars/scala-compiler-2.11.7.jar:/Users/jason/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.11.7.jar:/Users/jason/.ivy2/cache/org.scala-lang/scala-reflect/jars/scala-reflect-2.11.7.jar:/Users/jason/.ivy2/cache/org.scala-lang.modules/scala-xml_2.11/bundles/scala-xml_2.11-1.0.4.jar:/Users/jason/.ivy2/cache/org.scala-lang.modules/scala-parser-combinators_2.11/bundles/scala-parser-combinators_2.11-1.0.4.jar:/Users/jason/.ivy2/cache/org.scala-lang.modules/scala-async_2.11/bundles/scala-async_2.11-0.9.5.jar | |
[info] embeddedDefaults | |
[info] - classpath: . | |
[info] - bootclasspath: | |
[success] Total time: 0 s, completed 16/09/2015 11:30:29 AM |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.net.URLClassLoader | |
object Test { | |
def main(args: Array[String]): Unit = { | |
val loader = getClass.getClassLoader | |
loader match { | |
case u: URLClassLoader => println("u.getURLs = " + u.getURLs.map(u => new java.io.File(u.toURI).toString).mkString(":")) | |
case _ => println("loader.getClass", loader.getClass) | |
} | |
val settings = new scala.tools.nsc.Settings | |
settings.embeddedDefaults[Test.type] | |
println("embeddedDefaults") | |
println(" - classpath: " + settings.classpath.value) | |
println(" - bootclasspath: " + settings.bootclasspath.value) | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment