Skip to content

Commit 6a2d2c2

Browse files
authored
Merge pull request #78 from scala-exercises/enrique-2-13-1-update
Update evaluator to Scala 2.13.1
2 parents 0ee6715 + 11504f3 commit 6a2d2c2

File tree

14 files changed

+216
-277
lines changed

14 files changed

+216
-277
lines changed

.sbtopts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-Dscala.classpath.closeZip=true

.scalafmt.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
version = 2.3.2
12
style = defaultWithAlign
23
maxColumn = 100
34

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ sudo: required
33
services:
44
- docker
55
scala:
6-
- 2.12.10
6+
- 2.13.1
77
jdk:
88
- openjdk8
99
cache:
@@ -22,7 +22,7 @@ before_install:
2222
fi
2323

2424
after_success:
25-
- if [ "$TRAVIS_BRANCH" = "master" -a "$TRAVIS_PULL_REQUEST" = "false" -a "$TRAVIS_SCALA_VERSION" = "2.12.10" ]; then
25+
- if [ "$TRAVIS_BRANCH" = "master" -a "$TRAVIS_PULL_REQUEST" = "false" -a "$TRAVIS_SCALA_VERSION" = "2.13.1" ]; then
2626
sbt ++$TRAVIS_SCALA_VERSION publishSignedAll;
2727
echo "Deploying to Heroku";
2828
docker login --username=noel.m@47deg.com --password=$heroku_token registry.heroku.com;

build.sbt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
Universal / javaOptions += "-Dscala.classpath.closeZip=true"
2+
13
lazy val `evaluator-server` = (project in file("server"))
24
.enablePlugins(JavaAppPackaging)
35
.enablePlugins(AutomateHeaderPlugin)

project/ProjectPlugin.scala

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ object ProjectPlugin extends AutoPlugin {
1919
object autoImport {
2020

2121
object V {
22-
lazy val http4s = "0.20.15"
22+
lazy val cats = "2.1.0"
23+
lazy val http4s = "0.21.0-M6"
2324
lazy val circe = "0.12.3"
2425
lazy val log4s = "1.7.0"
2526
lazy val scalatest = "3.1.0"
@@ -44,33 +45,27 @@ object ProjectPlugin extends AutoPlugin {
4445
.user("evaluator")
4546
.add(artifact, artifactTargetPath)
4647
.cmdRaw(
47-
s"java -Dhttp.port=$$PORT -Deval.auth.secretKey=$$EVAL_SECRET_KEY -jar $artifactTargetPath")
48+
s"java -Dhttp.port=$$PORT -Deval.auth.secretKey=$$EVAL_SECRET_KEY -jar $artifactTargetPath"
49+
)
4850
},
49-
imageNames in docker := Seq(ImageName(repository =
50-
s"registry.heroku.com/${sys.props.getOrElse("evaluator.heroku.name", "scala-evaluator")}/web"))
51+
imageNames in docker := Seq(
52+
ImageName(repository =
53+
s"registry.heroku.com/${sys.props.getOrElse("evaluator.heroku.name", "scala-evaluator")}/web"
54+
)
55+
)
5156
)
5257

5358
lazy val serverScalaMacroDependencies: Seq[Setting[_]] = {
5459
Seq(
5560
libraryDependencies += "org.scala-lang" % "scala-compiler" % scalaVersion.value,
56-
libraryDependencies += "org.scala-lang" % "scala-reflect" % scalaVersion.value,
57-
libraryDependencies += compilerPlugin(%%("paradise") cross CrossVersion.full),
58-
libraryDependencies ++= {
59-
CrossVersion.partialVersion(scalaVersion.value) match {
60-
// if scala 2.11+ is used, quasiquotes are merged into scala-reflect
61-
case Some((2, scalaMajor)) if scalaMajor >= 11 => Seq()
62-
// in Scala 2.10, quasiquotes are provided by macro paradise
63-
case Some((2, 10)) =>
64-
Seq(
65-
%%("quasiquotes") cross CrossVersion.binary
66-
)
67-
}
68-
}
61+
libraryDependencies += "org.scala-lang" % "scala-reflect" % scalaVersion.value
6962
)
7063
}
7164

7265
lazy val serverHttpDependencies = Seq(
7366
libraryDependencies ++= Seq(
67+
%%("cats-core", V.cats),
68+
%%("cats-effect", V.cats),
7469
%%("circe-core", V.circe),
7570
%%("circe-generic", V.circe),
7671
%("slf4j-simple", V.slf4jSimple),
@@ -93,6 +88,8 @@ object ProjectPlugin extends AutoPlugin {
9388

9489
lazy val smoketestDependencies = Seq(
9590
libraryDependencies ++= Seq(
91+
%%("cats-core", V.cats),
92+
%%("cats-effect", V.cats),
9693
%%("circe-core", V.circe),
9794
%%("circe-generic", V.circe),
9895
%%("circe-parser", V.circe),
@@ -113,7 +110,8 @@ object ProjectPlugin extends AutoPlugin {
113110
resolvers ++= Seq(
114111
Resolver.mavenLocal,
115112
Resolver.sonatypeRepo("snapshots"),
116-
Resolver.sonatypeRepo("releases")),
113+
Resolver.sonatypeRepo("releases")
114+
),
117115
orgGithubSetting := GitHubSettings(
118116
organization = "scala-exercises",
119117
project = name.value,
@@ -123,11 +121,11 @@ object ProjectPlugin extends AutoPlugin {
123121
organizationEmail = "hello@47deg.com"
124122
),
125123
orgLicenseSetting := ApacheLicense,
126-
scalaVersion := "2.12.10",
124+
scalaVersion := "2.13.1",
127125
scalaOrganization := "org.scala-lang",
126+
scalacOptions ~= (_ filterNot (_ == "-Xfuture")),
127+
scalacOptions += "-Ymacro-annotations",
128128
javacOptions ++= Seq("-encoding", "UTF-8", "-Xlint:-options"),
129-
scalacOptions += "-Ypartial-unification",
130-
fork in Test := false,
131129
parallelExecution in Test := false,
132130
cancelable in Global := true,
133131
headerLicense := Some(
@@ -137,6 +135,7 @@ object ProjectPlugin extends AutoPlugin {
137135
| Copyright (C) 2015-2019 47 Degrees, LLC. <http://www.47deg.com>
138136
|
139137
|""".stripMargin
140-
))
138+
)
139+
)
141140
) ++ shellPromptSettings
142141
}

project/plugins.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.6.1")
33
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.10")
44
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.9.0")
55
addSbtPlugin("se.marcuslonnberg" % "sbt-docker" % "1.5.0")
6-
addSbtPlugin("com.47deg" % "sbt-org-policies" % "0.12.0-M3")
6+
addSbtPlugin("com.47deg" % "sbt-org-policies" % "0.12.3")
77
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "3.0.2")

server/src/main/scala/org/scalaexercises/evaluator/auth.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ package org.scalaexercises.evaluator
1010
import cats.effect.Sync
1111
import com.typesafe.config._
1212
import org.http4s._
13-
import org.http4s.syntax.kleisli.http4sKleisliResponseSyntax
13+
import org.http4s.syntax.kleisli._
1414
import org.http4s.util._
1515
import org.log4s.getLogger
1616
import pdi.jwt.{Jwt, JwtAlgorithm}
@@ -29,7 +29,8 @@ object auth {
2929
config.getString(SecretKeyPath)
3030
} else {
3131
throw new IllegalStateException(
32-
"Missing -Deval.auth.secretKey=[YOUR_KEY_HERE] or env var [EVAL_SECRET_KEY] ")
32+
"Missing -Deval.auth.secretKey=[YOUR_KEY_HERE] or env var [EVAL_SECRET_KEY] "
33+
)
3334
}
3435

3536
def generateToken(value: String = "{}") =

0 commit comments

Comments
 (0)