@@ -25,6 +25,8 @@ object ScalaModulePlugin extends Plugin {
25
25
// to allow compiling against snapshot versions of Scala
26
26
resolvers += Resolver .sonatypeRepo(" snapshots" ),
27
27
28
+ // resolvers += "scala-release-temp" at "http://private-repo.typesafe.com/typesafe/scala-release-temp/"
29
+
28
30
// don't use for doc scope, scaladoc warnings are not to be reckoned with
29
31
// TODO: turn on for nightlies, but don't enable for PR validation... "-Xfatal-warnings"
30
32
scalacOptions in compile ++= Seq (" -optimize" , " -feature" , " -deprecation" , " -unchecked" , " -Xlint" ),
@@ -44,6 +46,13 @@ object ScalaModulePlugin extends Plugin {
44
46
(baseDirectory.value / s " ${name.value}.properties " ) -> s " ${name.value}.properties "
45
47
},
46
48
49
+ // needed to fix classloader issues (see scala/scala-xml#20)
50
+ // essentially, the problem is that the run-time bootclasspath leaks into the compilation classpath,
51
+ // so that scalac see classes used to run it, as classes used to compile against...
52
+ // forking uses a minimal classpath, so this craziness is avoided
53
+ // alternatively, manage the scala instance as shown at the end of this file (commented)
54
+ fork in Test := true ,
55
+
47
56
publishArtifact in Test := false ,
48
57
49
58
// maven publishing
@@ -103,3 +112,16 @@ object ScalaModulePlugin extends Plugin {
103
112
// import com.typesafe.tools.mima.plugin.MimaKeys.previousArtifact
104
113
// previousArtifact := Some(organization.value %% name.value % binaryReferenceVersion.value)
105
114
}
115
+
116
+
117
+ // ALTERNATIVE to fork in test for fixing classpath issues noted above:
118
+ // manage the Scala instance ourselves to exclude the published scala-xml (scala-compiler depends on it)
119
+ // since this dependency hides the classes we're testing
120
+ // managedScalaInstance := false
121
+ //
122
+ // ivyConfigurations += Configurations.ScalaTool
123
+ //
124
+ // libraryDependencies ++= Seq(
125
+ // "org.scala-lang" % "scala-library" % scalaVersion.value,
126
+ // ("org.scala-lang" % "scala-compiler" % scalaVersion.value % "scala-tool").exclude("org.scala-lang.modules", s"scala-xml_${scalaBinaryVersion.value}")
127
+ // )
0 commit comments