Skip to content

Update to Scala 3.0.0-M2 #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ project/boot/
project/plugins/project/
project/local-plugins.sbt
.history
.bsp

# Scala-IDE specific
.scala_dependencies
Expand Down
4 changes: 2 additions & 2 deletions src/main/g8/build.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
val dottyVersion = "0.27.0-RC1"
val dottyVersion = "3.0.0-M2"

lazy val lib = project
.in(file("lib"))
Expand All @@ -20,7 +20,7 @@ lazy val inspector = project
scalaVersion := dottyVersion,

libraryDependencies ++= Seq(
"ch.epfl.lamp" %% "dotty-tasty-inspector" % dottyVersion,
"org.scala-lang" %% "scala3-tasty-inspector" % dottyVersion,
"com.novocode" % "junit-interface" % "0.11" % "test"
)
)
Expand Down
24 changes: 0 additions & 24 deletions src/main/g8/inspector/src/main/scala/Inspector.scala

This file was deleted.

23 changes: 23 additions & 0 deletions src/main/g8/inspector/src/main/scala/inspector/Inspector.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

package inspector

import scala.quoted._

import scala.tasty.inspector.TastyInspector

object Inspector {

def showCodeOf(tastyFile: String): String = {
var tastyStr: String = null
val inspector = new TastyInspector {
protected def processCompilationUnit(using Quotes)(root: quotes.reflect.Tree): Unit = {
import quotes.reflect._
val projectDir = new java.io.File( "." ).getCanonicalPath() + java.io.File.separator // To cleanup the paths in @SourceFile
tastyStr = root.show.replace(projectDir, "")
}
}
inspector.inspectTastyFiles(List(tastyFile))
tastyStr
}

}
9 changes: 9 additions & 0 deletions src/main/g8/inspector/src/main/scala/inspector/Main.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package inspector

import scala.quoted._

@main def run =
val tastyFile = "lib/target/scala-3.0.0-M2/classes/lib/Greetings.tasty"
val tastyContents = Inspector.showCodeOf(tastyFile)
println(tastyContents)

Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
package inspector

import scala.tasty.inspector._

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

}
Expand Down
2 changes: 1 addition & 1 deletion src/main/g8/project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.3.13
sbt.version=1.4.4
2 changes: 1 addition & 1 deletion src/main/g8/project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "0.4.2")
addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "0.4.6")