Skip to content

Commit 3c73a6c

Browse files
Merge pull request #5 from nicolasstucki/update/scala3.0.0-M2
Update to Scala 3.0.0-M2
2 parents 08a5247 + 4aa0cdc commit 3c73a6c

File tree

8 files changed

+39
-29
lines changed

8 files changed

+39
-29
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ project/boot/
1212
project/plugins/project/
1313
project/local-plugins.sbt
1414
.history
15+
.bsp
1516

1617
# Scala-IDE specific
1718
.scala_dependencies

src/main/g8/build.sbt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
val dottyVersion = "0.27.0-RC1"
1+
val dottyVersion = "3.0.0-M2"
22

33
lazy val lib = project
44
.in(file("lib"))
@@ -20,7 +20,7 @@ lazy val inspector = project
2020
scalaVersion := dottyVersion,
2121

2222
libraryDependencies ++= Seq(
23-
"ch.epfl.lamp" %% "dotty-tasty-inspector" % dottyVersion,
23+
"org.scala-lang" %% "scala3-tasty-inspector" % dottyVersion,
2424
"com.novocode" % "junit-interface" % "0.11" % "test"
2525
)
2626
)

src/main/g8/inspector/src/main/scala/Inspector.scala

Lines changed: 0 additions & 24 deletions
This file was deleted.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
2+
package inspector
3+
4+
import scala.quoted._
5+
6+
import scala.tasty.inspector.TastyInspector
7+
8+
object Inspector {
9+
10+
def showCodeOf(tastyFile: String): String = {
11+
var tastyStr: String = null
12+
val inspector = new TastyInspector {
13+
protected def processCompilationUnit(using Quotes)(root: quotes.reflect.Tree): Unit = {
14+
import quotes.reflect._
15+
val projectDir = new java.io.File( "." ).getCanonicalPath() + java.io.File.separator // To cleanup the paths in @SourceFile
16+
tastyStr = root.show.replace(projectDir, "")
17+
}
18+
}
19+
inspector.inspectTastyFiles(List(tastyFile))
20+
tastyStr
21+
}
22+
23+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package inspector
2+
3+
import scala.quoted._
4+
5+
@main def run =
6+
val tastyFile = "lib/target/scala-3.0.0-M2/classes/lib/Greetings.tasty"
7+
val tastyContents = Inspector.showCodeOf(tastyFile)
8+
println(tastyContents)
9+

src/main/g8/inspector/src/test/scala/Test.scala renamed to src/main/g8/inspector/src/test/scala/inspector/Test.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
package inspector
12

23
import scala.tasty.inspector._
34

@@ -13,7 +14,7 @@ class InspectorTest {
1314
| def hello(name: scala.Predef.String): scala.Predef.String = "Hello ".+(name)
1415
| }
1516
|}""".stripMargin,
16-
Inspector.showCodeOf("lib.Greetings")
17+
Inspector.showCodeOf("lib/target/scala-3.0.0-M2/classes/lib/Greetings.tasty")
1718
)
1819

1920
}

src/main/g8/project/build.properties

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

src/main/g8/project/plugins.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "0.4.2")
1+
addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "0.4.6")

0 commit comments

Comments
 (0)