![](/img/trans.png)
[英]What's the equivalent of `scala.tools.nsc.MainGenericRunner` in Scala 3?
[英]Where to acquire jar that provides scala.tools.nsc.MainGenericRunner
我的Lift項目我有一個名為LiftConsole.scala
的文件。 它由項目創建腳本生成,包含以下內容
import _root_.bootstrap.liftweb.Boot
import _root_.scala.tools.nsc.MainGenericRunner
object LiftConsole {
def main(args : Array[String]) {
// Instantiate your project's Boot file
val b = new Boot()
// Boot your project
b.boot
// Now run the MainGenericRunner to get your repl
MainGenericRunner.main(args)
// After the repl exits, then exit the scala script
exit(0)
}
}
看來這個文件的目的是讓用戶在項目中與控制台進行交互。 我喜歡這樣,但我從來沒能做到這一點,因為我找不到MainGenericRunner的jar。 有誰知道從哪里得到它?
我的目標是能夠初始化控制台將所有項目設置,以便我可以執行項目特定的代碼。
它是scala-compiler.jar
一部分。 您可以使用Scala分發的其余部分找到它。 將此添加到您的項目:
val scalaCompiler = "org.scala-lang" % "scala-compiler" % "2.8.1"
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.