Skip to content

Commit da82008

Browse files
author
James Santucci
committed
Back to 1.6.1
1 parent af86dad commit da82008

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=1.3.3
1+
sbt.version=1.6.1

sbt-exercise/src/main/scala/org/scalaexercises/exercises/sbtexercise/ExerciseCompilerPlugin.scala

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,16 @@ import java.io.PrintStream
2626
import sbt.{`package` => _, _}
2727
import sbt.Keys._
2828
import xsbt.api.Discovery
29+
import java.nio.file.Paths
2930
import cats.{`package` => _}
3031
import cats.data.Ior
3132
import cats.implicits._
3233
import sbt.internal.inc.Analysis
33-
import sbt.internal.inc.classpath.ClasspathUtilities
34+
import sbt.internal.inc.classpath.ClasspathUtil
3435
import sbtbuildinfo.BuildInfoPlugin
3536
import sbtbuildinfo.BuildInfoPlugin.autoImport._
3637
import xsbti.compile.CompileAnalysis
38+
import _root_.java.nio.file.Paths
3739

3840
/** The exercise compiler SBT auto plugin */
3941
object 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

Comments
 (0)