diff --git a/build.sbt b/build.sbt index a7b5743..57760a8 100644 --- a/build.sbt +++ b/build.sbt @@ -1,20 +1,28 @@ -import Dependencies._ -import com.github.retronym.SbtOneJar._ +name := "Conway's Game of Life" +version := conwaysVersion +organization := "org.juanitodread" -oneJarSettings +scalaVersion := "2.13.6" -lazy val root = (project in file(".")). - settings( - name := "Conway's Game of Life", - version := "1.1.2", - organization := "org.juanitodread", - scalaVersion := "2.11.11" - ). - settings( - libraryDependencies ++= backendDeps - ).settings( - scalacOptions += "-feature" - ).settings( - fork := true, // Enabling fork JVM to send the Java parameter that uses another sort algorithm - javaOptions ++= Seq("-Djava.util.Arrays.useLegacyMergeSort=true") - ) +lazy val root = project in file(".") + +lazy val conwaysVersion = "1.2.0" +lazy val scalaSwingVersion = "3.0.0" +lazy val scalaLoggingVersion = "3.9.4" +lazy val logbackVersion = "1.2.6" +lazy val scalaTestVersion = "3.2.9" + +libraryDependencies ++= Seq( + "org.scala-lang.modules" %% "scala-swing" % scalaSwingVersion, + "com.typesafe.scala-logging" %% "scala-logging" % scalaLoggingVersion, + "ch.qos.logback" % "logback-classic" % logbackVersion, + "org.scalatest" %% "scalatest" % scalaTestVersion % "test", +) + +scalacOptions += "-feature" + +fork := true // Enabling fork JVM to send the Java parameter that uses another sort algorithm +javaOptions ++= Seq("-Djava.util.Arrays.useLegacyMergeSort=true") + +mainClass := Some("org.juanitodread.conwaygameoflife.MainApp") +assemblyJarName := s"conways-game-of-life_${conwaysVersion}.jar" diff --git a/dist/conways-game-of-life_1.2.0.jar b/dist/conways-game-of-life_1.2.0.jar new file mode 100644 index 0000000..9e402a1 Binary files /dev/null and b/dist/conways-game-of-life_1.2.0.jar differ diff --git a/project/Dependencies.scala b/project/Dependencies.scala deleted file mode 100644 index 3528197..0000000 --- a/project/Dependencies.scala +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Conway's Game of Life - * - * Copyright 2015 juanitodread - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -import sbt._ - -object Dependencies { - // versions - lazy val scalaSwingVersion = "1.0.1" - lazy val scalaLoggingVersion = "3.1.0" - lazy val logbackVersion = "1.1.3" - lazy val scalaTestVersion = "3.0.1" - - // libraries - val scalaSwing = "org.scala-lang.modules" %% "scala-swing" % scalaSwingVersion - val scalaLogging = "com.typesafe.scala-logging" %% "scala-logging" % scalaLoggingVersion - val logback = "ch.qos.logback" % "logback-classic" % logbackVersion - val scalaTest = "org.scalatest" %% "scalatest" % scalaTestVersion % "test" - - // projects - val backendDeps = Seq(scalaSwing, - scalaLogging, - logback, - scalaTest) -} diff --git a/project/build.properties b/project/build.properties index da4bbed..d7ec7ac 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version = 0.13.9 \ No newline at end of file +sbt.version=1.3.13 \ No newline at end of file diff --git a/project/plugins.sbt b/project/plugins.sbt index 3a9b2e7..f879e43 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,8 +1,7 @@ // Scalariform -addSbtPlugin("org.scalariform" % "sbt-scalariform" % "1.6.0") +addSbtPlugin("org.scalariform" % "sbt-scalariform" % "1.8.2") // Scoverage addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.1") -addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "3.0.0") -addSbtPlugin("org.scala-sbt.plugins" % "sbt-onejar" % "0.8") +addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "1.1.0") diff --git a/src/main/scala/org/juanitodread/conwaygameoflife/view/ApplicationView.scala b/src/main/scala/org/juanitodread/conwaygameoflife/view/ApplicationView.scala index edd9086..c6b95c2 100644 --- a/src/main/scala/org/juanitodread/conwaygameoflife/view/ApplicationView.scala +++ b/src/main/scala/org/juanitodread/conwaygameoflife/view/ApplicationView.scala @@ -36,6 +36,8 @@ import org.juanitodread.conwaygameoflife.model.cell.{ State } +import scala.language.reflectiveCalls + import ExecutionContext.Implicits.global /** @@ -201,8 +203,8 @@ class ApplicationView(val boardSize: Int) extends SimpleSwingApplication with La Thread.sleep(ApplicationView.TimeSleep) } } - startFuture onSuccess { - case _ => logger.info("Future.onSuccess => Start action stopped") + startFuture onComplete { + case _ => logger.info("Future.onComplete => Start action stopped") } } case ButtonClicked(component) if component == leftPanel.stopBtn => { diff --git a/src/test/scala/org/juanitodread/conwaygameoflife/UnitSpec.scala b/src/test/scala/org/juanitodread/conwaygameoflife/UnitSpec.scala index 6288d25..e4ed0f0 100644 --- a/src/test/scala/org/juanitodread/conwaygameoflife/UnitSpec.scala +++ b/src/test/scala/org/juanitodread/conwaygameoflife/UnitSpec.scala @@ -1,6 +1,11 @@ package org.juanitodread.conwaygameoflife import org.scalatest._ +import flatspec._ +import matchers._ -abstract class UnitSpec extends FlatSpec - with Matchers with OptionValues with Inside with Inspectors \ No newline at end of file +abstract class UnitSpec extends AnyFlatSpec + with should.Matchers + with OptionValues + with Inside + with Inspectors \ No newline at end of file