Skip to content

Commit

Permalink
Merge pull request #914 from xuwei-k/scala-App
Browse files Browse the repository at this point in the history
avoid deprecated `scala.App`. add explicit main
  • Loading branch information
eed3si9n authored Oct 7, 2024
2 parents 1babad7 + 7965bed commit 1d65115
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 1d65115

Please sign in to comment.