Skip to content

Commit

Permalink
Merge pull request #1243 from lefou/deprecated-main
Browse files Browse the repository at this point in the history
Re-added but deprecated old Main entry point
  • Loading branch information
lefou authored Jan 13, 2022
2 parents 01d7b78 + 106f9a3 commit b0470ac
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion amm/src/main/scala/ammonite/AmmoniteMain.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ import coursierapi.Dependency
import scala.concurrent.Await
import scala.concurrent.duration.Duration


// needed to support deprecated Main.main
import acyclic.skipped

object AmmoniteMain{

Expand Down
6 changes: 6 additions & 0 deletions amm/src/main/scala/ammonite/Main.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import coursierapi.Dependency
import scala.concurrent.Await
import scala.concurrent.duration.Duration

// needed to support deprecated Main.main
import acyclic.skipped


/**
Expand Down Expand Up @@ -266,3 +268,7 @@ case class Main(predefCode: String = "",
}
}

object Main {
@deprecated("Use ammonite.AmmoniteMain.main instead", "2.5.0")
def main(args: Array[String]): Unit = AmmoniteMain.main(args)
}
2 changes: 2 additions & 0 deletions amm/src/main/scala/ammonite/MainRunner.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import scala.annotation.tailrec
import scala.concurrent.Await
import scala.concurrent.duration.Duration

// needed to support deprecated Main.main
import acyclic.skipped

/**
* Bundles together:
Expand Down

0 comments on commit b0470ac

Please sign in to comment.