From c9676177bda39fe76b7cd07e2eeb7614603a49b9 Mon Sep 17 00:00:00 2001 From: fredrikr79 Date: Tue, 14 Oct 2025 12:19:01 +0200 Subject: [PATCH] scala part 1 init --- flake.nix | 3 +++ scala_project_2025/part1/.gitignore | 4 ++++ scala_project_2025/part1/.scalafmt.conf | 2 ++ scala_project_2025/part1/README.md | 8 ++++++++ scala_project_2025/part1/build.sbt | 10 ++++++++++ scala_project_2025/part1/src/test/scala/MySuite.scala | 9 +++++++++ 6 files changed, 36 insertions(+) create mode 100644 scala_project_2025/part1/.gitignore create mode 100644 scala_project_2025/part1/.scalafmt.conf create mode 100644 scala_project_2025/part1/README.md create mode 100644 scala_project_2025/part1/build.sbt create mode 100644 scala_project_2025/part1/src/test/scala/MySuite.scala diff --git a/flake.nix b/flake.nix index 95e1485..d89ca90 100644 --- a/flake.nix +++ b/flake.nix @@ -15,6 +15,9 @@ devShells.${system}.default = pkgs.mkShell { buildInputs = with pkgs; [ mozart2-binary + sbt + scala + scalafmt ]; shellHook = '' echo "enjoy m*oz*art2" diff --git a/scala_project_2025/part1/.gitignore b/scala_project_2025/part1/.gitignore new file mode 100644 index 0000000..b52a582 --- /dev/null +++ b/scala_project_2025/part1/.gitignore @@ -0,0 +1,4 @@ +target/ +project/ +.bloop/ +.metals/ diff --git a/scala_project_2025/part1/.scalafmt.conf b/scala_project_2025/part1/.scalafmt.conf new file mode 100644 index 0000000..28e6bb0 --- /dev/null +++ b/scala_project_2025/part1/.scalafmt.conf @@ -0,0 +1,2 @@ +version = "3.9.6" +runner.dialect = scala3 diff --git a/scala_project_2025/part1/README.md b/scala_project_2025/part1/README.md new file mode 100644 index 0000000..102c5ca --- /dev/null +++ b/scala_project_2025/part1/README.md @@ -0,0 +1,8 @@ +## sbt project compiled with Scala 3 + +### Usage + +This is a normal sbt project. You can compile code with `sbt compile`, run it with `sbt run`, and `sbt console` will start a Scala 3 REPL. + +For more information on the sbt-dotty plugin, see the +[scala3-example-project](https://github.com/scala/scala3-example-project/blob/main/README.md). diff --git a/scala_project_2025/part1/build.sbt b/scala_project_2025/part1/build.sbt new file mode 100644 index 0000000..c30dcdd --- /dev/null +++ b/scala_project_2025/part1/build.sbt @@ -0,0 +1,10 @@ +val scala3Version = "3.7.3" + +lazy val root = project + .in(file(".")) + .settings( + name := "part1", + version := "0.1.0-SNAPSHOT", + scalaVersion := scala3Version, + libraryDependencies += "org.scalameta" %% "munit" % "1.0.0" % Test + ) diff --git a/scala_project_2025/part1/src/test/scala/MySuite.scala b/scala_project_2025/part1/src/test/scala/MySuite.scala new file mode 100644 index 0000000..621784d --- /dev/null +++ b/scala_project_2025/part1/src/test/scala/MySuite.scala @@ -0,0 +1,9 @@ +// For more information on writing tests, see +// https://scalameta.org/munit/docs/getting-started.html +class MySuite extends munit.FunSuite { + test("example test that succeeds") { + val obtained = 42 + val expected = 42 + assertEquals(obtained, expected) + } +}