From d318388c8ffe0905c9634b5d37b664c99a343a27 Mon Sep 17 00:00:00 2001 From: Orion Kindel Date: Thu, 30 Mar 2023 17:13:06 -0700 Subject: [PATCH] feat: initial commit (scala/scala3 tpl) --- .gitignore | 32 ++++++++++++++++++++++++++++++++ README.md | 8 ++++++++ build.sbt | 12 ++++++++++++ project/build.properties | 1 + src/main/scala/Main.scala | 5 +++++ src/test/scala/MySuite.scala | 9 +++++++++ 6 files changed, 67 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 build.sbt create mode 100644 project/build.properties create mode 100644 src/main/scala/Main.scala create mode 100644 src/test/scala/MySuite.scala diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9e79245 --- /dev/null +++ b/.gitignore @@ -0,0 +1,32 @@ +# macOS +.DS_Store + +# sbt specific +dist/* +target/ +lib_managed/ +src_managed/ +project/boot/ +project/plugins/project/ +project/local-plugins.sbt +.history +.ensime +.ensime_cache/ +.sbt-scripted/ +local.sbt + +# Bloop +.bsp + +# VS Code +.vscode/ + +# Metals +.bloop/ +.metals/ +metals.sbt + +# IDEA +.idea +.idea_modules +/.worksheet/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..102c5ca --- /dev/null +++ b/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/build.sbt b/build.sbt new file mode 100644 index 0000000..ad0691b --- /dev/null +++ b/build.sbt @@ -0,0 +1,12 @@ +val scala3Version = "3.2.2" + +lazy val root = project + .in(file(".")) + .settings( + name := "toad", + version := "0.1.0-SNAPSHOT", + + scalaVersion := scala3Version, + + libraryDependencies += "org.scalameta" %% "munit" % "0.7.29" % Test + ) diff --git a/project/build.properties b/project/build.properties new file mode 100644 index 0000000..46e43a9 --- /dev/null +++ b/project/build.properties @@ -0,0 +1 @@ +sbt.version=1.8.2 diff --git a/src/main/scala/Main.scala b/src/main/scala/Main.scala new file mode 100644 index 0000000..b51644b --- /dev/null +++ b/src/main/scala/Main.scala @@ -0,0 +1,5 @@ +@main def hello: Unit = + println("Hello world!") + println(msg) + +def msg = "I was compiled by Scala 3. :)" diff --git a/src/test/scala/MySuite.scala b/src/test/scala/MySuite.scala new file mode 100644 index 0000000..621784d --- /dev/null +++ b/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) + } +}