@@ -26,14 +26,16 @@ import java.io.PrintStream
2626import sbt .{`package` => _ , _ }
2727import sbt .Keys ._
2828import xsbt .api .Discovery
29+ import java .nio .file .Paths
2930import cats .{`package` => _ }
3031import cats .data .Ior
3132import cats .implicits ._
3233import sbt .internal .inc .Analysis
33- import sbt .internal .inc .classpath .ClasspathUtilities
34+ import sbt .internal .inc .classpath .ClasspathUtil
3435import sbtbuildinfo .BuildInfoPlugin
3536import sbtbuildinfo .BuildInfoPlugin .autoImport ._
3637import xsbti .compile .CompileAnalysis
38+ import _root_ .java .nio .file .Paths
3739
3840/** The exercise compiler SBT auto plugin */
3941object ExerciseCompilerPlugin extends AutoPlugin {
@@ -165,12 +167,12 @@ object ExerciseCompilerPlugin extends AutoPlugin {
165167
166168 val libraryClasspath = Attributed .data((Compile / fullClasspath).value)
167169 val classpath = (Meta .compilerClasspath ++ libraryClasspath).distinct
168- val loader = ClasspathUtilities .toLoader(
169- classpath,
170+ val loader = ClasspathUtil .toLoader(
171+ classpath.map(file => Paths .get(file.getAbsolutePath())) ,
170172 null ,
171- ClasspathUtilities .createClasspathResources(
172- appPaths = Meta .compilerClasspath,
173- bootPaths = scalaInstance.value.allJars
173+ ClasspathUtil .createClasspathResources(
174+ appPaths = Meta .compilerClasspath.map(file => Paths .get(file.getAbsolutePath())) ,
175+ bootPaths = scalaInstance.value.allJars.map(file => Paths .get(file.getAbsolutePath()))
174176 )
175177 )
176178
@@ -210,7 +212,15 @@ object ExerciseCompilerPlugin extends AutoPlugin {
210212 .flatMap(analysisIn match {
211213 case analysis : Analysis => analysis.relations.definesClass
212214 })
213- .map { file => (file.getPath, IO .read(file))
215+ .map { file =>
216+ (
217+ file.name(),
218+ IO .read(
219+ new File (
220+ (baseDir.getParentFile() +: file.names().tail).mkString(" /" )
221+ )
222+ )
223+ )
214224 }
215225
216226 captureStdStreams(
0 commit comments