Skip to content

Commit

Permalink
avoid deprecated scala.App. add explicit main
Browse files Browse the repository at this point in the history
  • Loading branch information
xuwei-k committed Oct 7, 2024
1 parent 1babad7 commit 7965bed
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 13 deletions.
8 changes: 5 additions & 3 deletions launcher/src/main/scala/LauncherMain.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ import java.util.Properties
import java.lang.reflect.InvocationTargetException
import java.nio.file.{Files, StandardCopyOption}

object LauncherMain extends Runner with App {
java.util.logging.Logger.getLogger("").setLevel(java.util.logging.Level.SEVERE)
object LauncherMain extends Runner {
def main(args: Array[String]): Unit = {
java.util.logging.Logger.getLogger("").setLevel(java.util.logging.Level.SEVERE)

System.exit(run(args, new LauncherProcessor))
System.exit(run(args, new LauncherProcessor))
}
}

class LauncherProcessor extends Processor {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.example

object Main extends App {
println("Hello from project Example SBT project")
object Main {
def main(args: Array[String]): Unit = {
println("Hello from project Example SBT project")
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package $package$

object Main extends App {
println("Hello from project $name$")
object Main {
def main(args: Array[String]): Unit = {
println("Hello from project $name$")
}
}
6 changes: 4 additions & 2 deletions plugin/src/sbt-test/giter8/root-layout/Main.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

package $package$

object Main extends App {
println("hello")
object Main {
def main(args: Array[String]): Unit = {
println("hello")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
* limitations under the License.
*/

object Main extends App {
println("hello")
object Main {
def main(args: Array[String]): Unit = {
println("hello")
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package $package$

object Main extends App {
println("Hello from project without name")
object Main {
def main(args: Array[String]): Unit = {
println("Hello from project without name")
}
}

0 comments on commit 7965bed

Please sign in to comment.