Skip to content

Commit

Permalink
Bump to Scala 2.13 and dependencies (#15)
Browse files Browse the repository at this point in the history
* Bump to Scala 2.13

* Replace one-jar with sbt-assembly
  • Loading branch information
juanitodread authored Sep 19, 2021
1 parent b08e4c9 commit f35f3f7
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 66 deletions.
44 changes: 26 additions & 18 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -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"
Binary file added dist/conways-game-of-life_1.2.0.jar
Binary file not shown.
40 changes: 0 additions & 40 deletions project/Dependencies.scala

This file was deleted.

2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version = 0.13.9
sbt.version=1.3.13
5 changes: 2 additions & 3 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -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")
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ import org.juanitodread.conwaygameoflife.model.cell.{
State
}

import scala.language.reflectiveCalls

import ExecutionContext.Implicits.global

/**
Expand Down Expand Up @@ -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 => {
Expand Down
Original file line number Diff line number Diff line change
@@ -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
abstract class UnitSpec extends AnyFlatSpec
with should.Matchers
with OptionValues
with Inside
with Inspectors

0 comments on commit f35f3f7

Please sign in to comment.