init(15): sbt project with mainargs
This commit is contained in:
parent
084035fdcb
commit
c27cb67c2a
2
.scalafmt.conf
Normal file
2
.scalafmt.conf
Normal file
@ -0,0 +1,2 @@
|
||||
version = "3.7.3"
|
||||
runner.dialect = scala3
|
16
15-multi-step-form/.gitignore
vendored
Normal file
16
15-multi-step-form/.gitignore
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
.bsp/
|
||||
.scala-build/
|
||||
.metals/
|
||||
.direnv
|
||||
*/dist/
|
||||
/11-single-price-grid-component/.bloop/
|
||||
|
||||
**/.bloop
|
||||
**/project/project/
|
||||
**/project/metals.sbt
|
||||
**/project/.bloop
|
||||
**/project/target/
|
||||
**/target/
|
||||
|
||||
*/result
|
||||
result
|
0
15-multi-step-form/.project
Normal file
0
15-multi-step-form/.project
Normal file
16
15-multi-step-form/build.sbt
Normal file
16
15-multi-step-form/build.sbt
Normal file
@ -0,0 +1,16 @@
|
||||
ThisBuild / scalaVersion := "3.2.2"
|
||||
|
||||
fork := true
|
||||
|
||||
ThisBuild / version := "0.0.1"
|
||||
ThisBuild / organization := "industries.sunshine"
|
||||
|
||||
lazy val multiStepForm = (project in file("."))
|
||||
.settings(
|
||||
name := "multi-step-form",
|
||||
libraryDependencies ++= Seq(
|
||||
"com.lihaoyi" %% "cask" % "0.9.1",
|
||||
"com.lihaoyi" %% "mainargs" % "0.5.0",
|
||||
"org.thymeleaf" % "thymeleaf" % "3.1.1.RELEASE"
|
||||
)
|
||||
)
|
1
15-multi-step-form/project/build.properties
Normal file
1
15-multi-step-form/project/build.properties
Normal file
@ -0,0 +1 @@
|
||||
sbt.version=1.9.0
|
16
15-multi-step-form/src/main/scala/multistepform/Main.scala
Normal file
16
15-multi-step-form/src/main/scala/multistepform/Main.scala
Normal file
@ -0,0 +1,16 @@
|
||||
package multistepform
|
||||
|
||||
import mainargs.{main, arg, ParserForMethods}
|
||||
|
||||
object Main {
|
||||
@main def run(
|
||||
@arg(name="port", short='p', doc="Port on which server will start service")
|
||||
portArg: Int = 8080,
|
||||
@arg(name="host", doc="Host on which server will start serving")
|
||||
hostArg: String = "localhost"
|
||||
): Unit = {
|
||||
println(s"Will start server on ${hostArg}:${portArg}")
|
||||
}
|
||||
|
||||
def main(args: Array[String]): Unit = ParserForMethods(this).runOrExit(args)
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
package example
|
||||
|
||||
class ExampleSuite extends munit.FunSuite:
|
||||
|
||||
test("addition") {
|
||||
assert(1 + 1 == 2)
|
||||
}
|
||||
end ExampleSuite
|
Loading…
x
Reference in New Issue
Block a user