From e62abfc29d693c0df04a00b8eb8e4eba403dd271 Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Tue, 12 Nov 2024 22:27:19 +0100 Subject: [PATCH 1/2] make Scala 3 the default version but the code is also still valid Scala 2 code so if someone explicitly chooses Scala 2 instead, that's okay --- README.md | 10 +++++----- src/main/g8/default.properties | 2 +- .../g8/src/main/scala/$package$/CubeCalculator.scala | 7 +++---- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index db68e21..d146c95 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,16 @@ A [Giter8][g8] template for trying out ScalaTest, used in the [Getting Started with Scala guide](https://docs.scala-lang.org/getting-started-sbt-track/testing-scala-with-sbt-on-the-command-line.html). ##### To create the project using this template: - - Run this in the sbt console: + - Run this in the sbt console: `sbt new scala/scalatest-example.g8` - When prompted for name, enter any name you want - - For example : 'hello' - .... + - For example : 'hello + .... Template applied in ./hello - + Template license ---------------- -Written in 2017-2021 by the Scala Center +Written in 2017-2024 by the Scala Center To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this template to the public domain worldwide. diff --git a/src/main/g8/default.properties b/src/main/g8/default.properties index cab1886..2958fe4 100644 --- a/src/main/g8/default.properties +++ b/src/main/g8/default.properties @@ -1,5 +1,5 @@ name=My Something Project description=Say something about this template. package=com.example -scala-version=2.13.15 +scala-version=3.5.2 scalatest-version=3.2.19 diff --git a/src/main/g8/src/main/scala/$package$/CubeCalculator.scala b/src/main/g8/src/main/scala/$package$/CubeCalculator.scala index c5269c4..7590fc0 100644 --- a/src/main/g8/src/main/scala/$package$/CubeCalculator.scala +++ b/src/main/g8/src/main/scala/$package$/CubeCalculator.scala @@ -1,5 +1,4 @@ -object CubeCalculator extends App { - def cube(x: Int) = { +object CubeCalculator { + def cube(x: Int): Int = x * x * x - } -} \ No newline at end of file +} From 68546b830dcf01abeca042ade04a964b2cab7254 Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Wed, 13 Nov 2024 09:49:09 +0100 Subject: [PATCH 2/2] Update README.md Co-authored-by: adpi2 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d146c95..d1b745e 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ A [Giter8][g8] template for trying out ScalaTest, used in the [Getting Started w - Run this in the sbt console: `sbt new scala/scalatest-example.g8` - When prompted for name, enter any name you want - - For example : 'hello + - For example : 'hello' .... Template applied in ./hello