From d0f8cd771e489c9cd09eb69f137157b9819ee9f2 Mon Sep 17 00:00:00 2001 From: efim Date: Wed, 28 Jun 2023 06:11:07 +0000 Subject: [PATCH] init(12): new sbt project: static price component --- .gitignore | 11 +++++----- 12-order-summary-component-thymeleaf/.project | 0 .../.scalafmt.conf | 2 ++ .../build.sbt | 20 +++++++++++++++++++ .../project/build.properties | 1 + .../src/main/scala/example/Main.scala | 20 +++++++++++++++++++ .../src/test/scala/example/ExampleSuite.scala | 8 ++++++++ 7 files changed, 57 insertions(+), 5 deletions(-) create mode 100644 12-order-summary-component-thymeleaf/.project create mode 100644 12-order-summary-component-thymeleaf/.scalafmt.conf create mode 100644 12-order-summary-component-thymeleaf/build.sbt create mode 100644 12-order-summary-component-thymeleaf/project/build.properties create mode 100644 12-order-summary-component-thymeleaf/src/main/scala/example/Main.scala create mode 100644 12-order-summary-component-thymeleaf/src/test/scala/example/ExampleSuite.scala diff --git a/.gitignore b/.gitignore index 6ce52a4..b6ed91e 100644 --- a/.gitignore +++ b/.gitignore @@ -5,11 +5,12 @@ */dist/ /11-single-price-grid-component/.bloop/ -*/project/project/ -*/project/metals.sbt -*/project/.bloop -*/project/target/ -*/target/ +**/.bloop +**/project/project/ +**/project/metals.sbt +**/project/.bloop +**/project/target/ +**/target/ */result result diff --git a/12-order-summary-component-thymeleaf/.project b/12-order-summary-component-thymeleaf/.project new file mode 100644 index 0000000..e69de29 diff --git a/12-order-summary-component-thymeleaf/.scalafmt.conf b/12-order-summary-component-thymeleaf/.scalafmt.conf new file mode 100644 index 0000000..db004c6 --- /dev/null +++ b/12-order-summary-component-thymeleaf/.scalafmt.conf @@ -0,0 +1,2 @@ +version = "3.7.3" +runner.dialect = scala3 \ No newline at end of file diff --git a/12-order-summary-component-thymeleaf/build.sbt b/12-order-summary-component-thymeleaf/build.sbt new file mode 100644 index 0000000..3b885b7 --- /dev/null +++ b/12-order-summary-component-thymeleaf/build.sbt @@ -0,0 +1,20 @@ +ThisBuild / scalaVersion := "3.2.2" +fork := true + +ThisBuild / version := "0.0.1" +ThisBuild / organization := "industries.sunshine" + +val toolkitV = "0.1.7" +val toolkit = "org.scala-lang" %% "toolkit" % toolkitV +val toolkitTest = "org.scala-lang" %% "toolkit-test" % toolkitV + +lazy val root = (project in file(".")) + .settings( + name := "order-summary-component", + libraryDependencies += toolkit, + libraryDependencies += (toolkitTest % Test), + libraryDependencies ++= Seq( + "com.lihaoyi" %% "cask" % "0.9.1", + "com.lihaoyi" %% "mainargs" % "0.5.0" + ) + ) diff --git a/12-order-summary-component-thymeleaf/project/build.properties b/12-order-summary-component-thymeleaf/project/build.properties new file mode 100644 index 0000000..40b3b8e --- /dev/null +++ b/12-order-summary-component-thymeleaf/project/build.properties @@ -0,0 +1 @@ +sbt.version=1.9.0 diff --git a/12-order-summary-component-thymeleaf/src/main/scala/example/Main.scala b/12-order-summary-component-thymeleaf/src/main/scala/example/Main.scala new file mode 100644 index 0000000..3dd902e --- /dev/null +++ b/12-order-summary-component-thymeleaf/src/main/scala/example/Main.scala @@ -0,0 +1,20 @@ +package example + +import mainargs.{main, arg, ParserForMethods} + +object Main { + @main def run( + @arg( + name = "post", + short = 'p', + doc = "Port on which server will start serving." + ) + 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) + +} diff --git a/12-order-summary-component-thymeleaf/src/test/scala/example/ExampleSuite.scala b/12-order-summary-component-thymeleaf/src/test/scala/example/ExampleSuite.scala new file mode 100644 index 0000000..26c55ab --- /dev/null +++ b/12-order-summary-component-thymeleaf/src/test/scala/example/ExampleSuite.scala @@ -0,0 +1,8 @@ +package example + +class ExampleSuite extends munit.FunSuite: + + test("addition") { + assert(1 + 1 == 2) + } +end ExampleSuite