From eaf52e0d8226ca5731969caaa1ee7f342eeee8a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sim=C3=A3o=20Martins?= Date: Tue, 16 Mar 2021 17:10:49 +0000 Subject: [PATCH] Update dependencies. --- build.sbt | 22 +++++++++---------- project/build.properties | 2 +- .../org/fenixedu/sdk/services/package.scala | 3 +-- .../scala/org/fenixedu/sdk/CoursesSpec.scala | 3 ++- version.sbt | 2 +- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/build.sbt b/build.sbt index 65f8ce0..12abbb6 100644 --- a/build.sbt +++ b/build.sbt @@ -5,7 +5,7 @@ name := "fenixedu-scala-sdk" // ==== Compile Options ================================================================================================= // ====================================================================================================================== javacOptions ++= Seq("-Xlint", "-encoding", "UTF-8", "-Dfile.encoding=utf-8") -scalaVersion := "2.13.4" +scalaVersion := "2.13.5" scalacOptions ++= Seq( "-encoding", "utf-8", // Specify character encoding used by source files. @@ -31,10 +31,10 @@ scalacOptions ++= Seq( // These lines ensure that in sbt console or sbt test:console the -Ywarn* and the -Xfatal-warning are not bothersome. // https://stackoverflow.com/questions/26940253/in-sbt-how-do-you-override-scalacoptions-for-console-in-all-configurations -scalacOptions in (Compile, console) ~= (_.filterNot { option => +Compile / console / scalacOptions ~= (_.filterNot { option => option.startsWith("-W") || option.startsWith("-Xlint") }) -scalacOptions in (Test, console) := (scalacOptions in (Compile, console)).value +Test / console / scalacOptions := (Test / console / scalacOptions).value initialCommands in console := """import scala.concurrent.ExecutionContext @@ -54,13 +54,13 @@ initialCommands in console := // ==== Dependencies ==================================================================================================== // ====================================================================================================================== libraryDependencies ++= Seq("blaze-client", "circe").map { module => - "org.http4s" %% s"http4s-$module" % "1.0.0-M13" + "org.http4s" %% s"http4s-$module" % "1.0.0-M19" } ++ Seq( "io.circe" %% "circe-derivation" % "0.13.0-M5", "io.circe" %% "circe-parser" % "0.13.0", "com.beachape" %% "enumeratum-circe" % "1.6.1", "ch.qos.logback" % "logback-classic" % "1.2.3" % Test, - "org.scalatest" %% "scalatest" % "3.2.3" % Test, + "org.scalatest" %% "scalatest" % "3.2.6" % Test, ) addCompilerPlugin("com.olegpy" %% "better-monadic-for" % "0.3.1") @@ -83,7 +83,7 @@ Test / testGrouping := { // http://www.scalatest.org/user_guide/using_the_runner // -o[configs...] - causes test results to be written to the standard output. The D configs shows all durations. -testOptions in Test += Tests.Argument(TestFrameworks.ScalaTest, "-oD") +Test / testOptions += Tests.Argument(TestFrameworks.ScalaTest, "-oD") // ====================================================================================================================== // ==== Scaladoc ======================================================================================================== @@ -97,7 +97,7 @@ latestReleasedVersion := git.gitDescribedVersion.value.getOrElse("0.0.1-SNAPSHOT // link against the API documentation using autoAPIMappings. apiURL := Some(url(s"${homepage.value.get}/api/${latestReleasedVersion.value}/")) autoAPIMappings := true // Tell scaladoc to look for API documentation of managed dependencies in their metadata. -scalacOptions in (Compile, doc) ++= Seq( +Compile / doc / scalacOptions ++= Seq( "-author", // Include authors. "-diagrams", // Create inheritance diagrams for classes, traits and packages. "-groups", // Group similar functions together (based on the @group annotation) @@ -105,12 +105,12 @@ scalacOptions in (Compile, doc) ++= Seq( "-doc-title", name.value.capitalize, "-doc-version", latestReleasedVersion.value, "-doc-source-url", s"${homepage.value.get}/tree/v${latestReleasedVersion.value}€{FILE_PATH}.scala", - "-sourcepath", (baseDirectory in ThisBuild).value.getAbsolutePath, + "-sourcepath", baseDirectory.value.getAbsolutePath, ) enablePlugins(GhpagesPlugin, SiteScaladocPlugin) -siteSubdirName in SiteScaladoc := s"api/${version.value}" -excludeFilter in ghpagesCleanSite := AllPassFilter // We want to keep all the previous API versions +SiteScaladoc / siteSubdirName := s"api/${version.value}" +ghpagesCleanSite / excludeFilter := AllPassFilter // We want to keep all the previous API versions val latestFileName = "latest" val createLatestSymlink = taskKey[Unit](s"Creates a symlink named $latestFileName which points to the latest version.") createLatestSymlink := { @@ -122,7 +122,7 @@ createLatestSymlink := { ghpagesPushSite := ghpagesPushSite.dependsOn(createLatestSymlink).value ghpagesBranch := "gh-pages" ghpagesNoJekyll := false -envVars in ghpagesPushSite := Map("SBT_GHPAGES_COMMIT_MESSAGE" -> s"Add Scaladocs for version ${latestReleasedVersion.value}") +ghpagesPushSite / envVars := Map("SBT_GHPAGES_COMMIT_MESSAGE" -> s"Add Scaladocs for version ${latestReleasedVersion.value}") // ====================================================================================================================== // ==== Publishing/Release ============================================================================================== diff --git a/project/build.properties b/project/build.properties index d91c272..0a45841 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.4.6 +sbt.version=1.5.0-RC1 diff --git a/src/main/scala/org/fenixedu/sdk/services/package.scala b/src/main/scala/org/fenixedu/sdk/services/package.scala index 924f235..2e96567 100644 --- a/src/main/scala/org/fenixedu/sdk/services/package.scala +++ b/src/main/scala/org/fenixedu/sdk/services/package.scala @@ -1,13 +1,12 @@ package org.fenixedu.sdk -import cats.Applicative import cats.effect.Concurrent import io.circe.{Decoder, Encoder, Printer} import org.http4s.{EntityDecoder, EntityEncoder, circe} package object services { val jsonPrinter: Printer = Printer.noSpaces.copy(dropNullValues = true) - implicit def jsonEncoder[F[_]: Applicative, A: Encoder]: EntityEncoder[F, A] = circe.jsonEncoderWithPrinterOf[F, A](jsonPrinter) + implicit def jsonEncoder[F[_], A: Encoder]: EntityEncoder[F, A] = circe.jsonEncoderWithPrinterOf[F, A](jsonPrinter) implicit def jsonDecoder[F[_]: Concurrent, A: Decoder]: EntityDecoder[F, A] = circe.accumulatingJsonOf[F, A] // Without this decoding to Unit wont work. This makes the EntityDecoder[F, Unit] defined in EntityDecoder companion object diff --git a/src/test/scala/org/fenixedu/sdk/CoursesSpec.scala b/src/test/scala/org/fenixedu/sdk/CoursesSpec.scala index 8237936..5d5798e 100644 --- a/src/test/scala/org/fenixedu/sdk/CoursesSpec.scala +++ b/src/test/scala/org/fenixedu/sdk/CoursesSpec.scala @@ -10,7 +10,8 @@ class CoursesSpec extends Utils { def forAcademicTerm(year: Int) = { val academicTerm = s"$year/${year + 1}" client.degrees.list(academicTerm = Some(academicTerm)) - .flatMap(_.parTraverse(degree => client.degrees.courses(degree.id, Some(academicTerm)).map(courses => (degree, courses.take(3))))) + // This degree is causing a lot of duplicate test name exception + .flatMap(_.filter(_.acronym != "DETPT").parTraverse(degree => client.degrees.courses(degree.id, Some(academicTerm)).map(courses => (degree, courses.take(3))))) .unsafeRunSync() .foreach { case (degree, courses) => s"the degree is ${degree.acronym} (${degree.id}) on academic term $academicTerm" should { diff --git a/version.sbt b/version.sbt index 2c9556a..ce43be0 100644 --- a/version.sbt +++ b/version.sbt @@ -1 +1 @@ -version := "0.2.0-SNAPSHOT" +version := "0.3.0"