File tree Expand file tree Collapse file tree 5 files changed +20
-8
lines changed
compiler/src/main/scala/org/scalaexercises/exercises/compiler
main/scala/org/scalaexercises/exercises/sbtexercise Expand file tree Collapse file tree 5 files changed +20
-8
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ class CompilerJava {
5151 targetPackage,
5252 fetchContributors
5353 )
54- .fold(`🍺` => throw new Exception (`🍺` ), out => Array (out._1, out._2))
54+ .fold(err => throw new Exception (err ), out => Array (out._1, out._2))
5555 }
5656}
5757
Original file line number Diff line number Diff line change 1- sbt.version =1.3.13
1+ sbt.version =1.4.7
Original file line number Diff line number Diff line change @@ -26,15 +26,18 @@ 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 ._
32- import sbt .internal .inc .Analysis
33+ import sbt .internal .inc .{ Analysis , MappedVirtualFile }
3334import sbt .internal .inc .classpath .ClasspathUtilities
3435import sbtbuildinfo .BuildInfoPlugin
3536import sbtbuildinfo .BuildInfoPlugin .autoImport ._
3637import xsbti .compile .CompileAnalysis
3738
39+ import scala .jdk .CollectionConverters ._
40+
3841/** The exercise compiler SBT auto plugin */
3942object ExerciseCompilerPlugin extends AutoPlugin {
4043
@@ -210,7 +213,16 @@ object ExerciseCompilerPlugin extends AutoPlugin {
210213 .flatMap(analysisIn match {
211214 case analysis : Analysis => analysis.relations.definesClass
212215 })
213- .map(file => (file.getPath, IO .read(file)))
216+ .map { file =>
217+ (
218+ file.name(),
219+ IO .read(
220+ new File (
221+ (baseDir.getParentFile() +: file.names().tail).mkString(" /" )
222+ )
223+ )
224+ )
225+ }
214226
215227 captureStdStreams(
216228 fOut = log.info(_ : String ),
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ val pluginVersion = System.getProperty("plugin.version")
55lazy val content = (project in file(" content" ))
66 .enablePlugins(ExerciseCompilerPlugin )
77 .settings(
8- scalaVersion := " 2.12.11 " ,
8+ scalaVersion := " 2.12.15 " ,
99 resolvers ++= Seq (
1010 Resolver .sonatypeRepo(" snapshots" ),
1111 Resolver .defaultLocal
@@ -20,7 +20,7 @@ lazy val content = (project in file("content"))
2020lazy val contentInPackages = (project in file(" contentinpackages" ))
2121 .enablePlugins(ExerciseCompilerPlugin )
2222 .settings(
23- scalaVersion := " 2.12.11 " ,
23+ scalaVersion := " 2.12.15 " ,
2424 resolvers ++= Seq (
2525 Resolver .sonatypeRepo(" snapshots" ),
2626 Resolver .defaultLocal
@@ -35,7 +35,7 @@ lazy val contentInPackages = (project in file("contentinpackages"))
3535lazy val check = (project in file(" check" ))
3636 .dependsOn(content, contentInPackages)
3737 .settings(
38- scalaVersion := " 2.12.11 " ,
38+ scalaVersion := " 2.12.15 " ,
3939 resolvers ++= Seq (
4040 Resolver .sonatypeRepo(" snapshots" ),
4141 Resolver .defaultLocal
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ val pluginVersion = System.getProperty("plugin.version")
22
33lazy val root = (project in file(" ." ))
44 .settings(
5- scalaVersion := " 2.12.11 " ,
5+ scalaVersion := " 2.12.15 " ,
66 resolvers ++= Seq (
77 Resolver .sonatypeRepo(" snapshots" ),
88 Resolver .defaultLocal
You can’t perform that action at this time.
0 commit comments