Skip to content

Commit

Permalink
add @main entrypoint support for Scala 3
Browse files Browse the repository at this point in the history
mainargs 0.2.3 added support for scala3 🎉
com-lihaoyi/mainargs#18

The first attempt to upgrade and enable mainargs was
com-lihaoyi#1298, but the build
changes were better handled by com-lihaoyi#1301

So the only thing left is reenabling mainargs for Scala 3.
  • Loading branch information
mpollmeier committed Oct 17, 2022
1 parent 5a06226 commit 32e45a4
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions amm/src/main/scala/ammonite/main/Scripts.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,7 @@ object Scripts {
scriptArgs: Seq[String] = Nil) = {
interp.watch(path)
val (pkg, wrapper) = Util.pathToPackageWrapper(Seq(), path relativeTo wd)


val genRoutesCode =
// Entrypoints are not supported in Scala 3 for now (its macros are Scala 2-only)
if (interp.compilerBuilder.scalaVersion.startsWith("3.")) "null"
else "mainargs.ParserForMethods[$routesOuter.type]($routesOuter)"
val genRoutesCode = "mainargs.ParserForMethods[$routesOuter.type]($routesOuter)"

for{
scriptTxt <- try Res.Success(Util.normalizeNewlines(os.read(path))) catch{
Expand Down

0 comments on commit 32e45a4

Please sign in to comment.