Skip to content

Commit

Permalink
Close #421 - Upgrade libraries
Browse files Browse the repository at this point in the history
* cats to 2.10.0
* cats-effect to 3.5.2
* extras to 0.44.0
* effectie to 2.0.0-beta13
* logger-f to 2.0.0-beta22
* refined to 0.11.0
* circe to 0.14.6
* http4s to 0.23.24
* just-semver to 0.13.0
  • Loading branch information
kevin-lee committed Nov 17, 2023
1 parent f7cc43f commit e719861
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 43 deletions.
67 changes: 33 additions & 34 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
import BuildTools._
import ProjectInfo._

ThisBuild / scalaVersion := props.ProjectScalaVersion
ThisBuild / scalaVersion := props.ProjectScalaVersion
ThisBuild / crossSbtVersions := props.CrossSbtVersions
ThisBuild / developers := List(
ThisBuild / developers := List(
Developer(
props.GitHubUsername,
"Kevin Lee",
"[email protected]",
url(s"https://github.com/${props.GitHubUsername}"),
),
)
ThisBuild / homepage := url(s"https://github.com/${props.GitHubUsername}/${props.ProjectName}").some
ThisBuild / scmInfo :=
ThisBuild / homepage := url(s"https://github.com/${props.GitHubUsername}/${props.ProjectName}").some
ThisBuild / scmInfo :=
ScmInfo(
url(s"https://github.com/${props.GitHubUsername}/${props.ProjectName}"),
s"[email protected]:${props.GitHubUsername}/${props.ProjectName}.git",
).some
ThisBuild / licenses := List("MIT" -> url("http://opensource.org/licenses/MIT"))
ThisBuild / startYear := 2018.some
ThisBuild / licenses := List("MIT" -> url("http://opensource.org/licenses/MIT"))
ThisBuild / startYear := 2018.some
ThisBuild / testFrameworks ~=
(frameworks => (TestFramework("hedgehog.sbt.Framework") +: frameworks).distinct)
ThisBuild / resolvers += "sonatype-snapshots" at s"https://${props.SonatypeCredentialHost}/content/repositories/snapshots"

Global / sbtVersion := props.GlobalSbtVersion
Global / sbtVersion := props.GlobalSbtVersion

lazy val sbtDevOops = Project(props.ProjectName, file("."))
.enablePlugins(SbtPlugin)
.enablePlugins(DevOopsGitHubReleasePlugin, DocusaurPlugin)
.settings(
organization := props.Org,
name := props.ProjectName,
description := "DevOops - DevOps tool for GitHub",
writeVersion := versionWriter(Def.spaceDelimited("filename").parsed)(version.value),
docusaurDir := (ThisBuild / baseDirectory).value / "website",
docusaurBuildDir := docusaurDir.value / "build",
gitHubPagesOrgName := props.GitHubUsername,
organization := props.Org,
name := props.ProjectName,
description := "DevOops - DevOps tool for GitHub",
writeVersion := versionWriter(Def.spaceDelimited("filename").parsed)(version.value),
docusaurDir := (ThisBuild / baseDirectory).value / "website",
docusaurBuildDir := docusaurDir.value / "build",
gitHubPagesOrgName := props.GitHubUsername,
gitHubPagesRepoName := props.ProjectName,
publishMavenStyle := true,
publishMavenStyle := true,
)
.settings(mavenCentralPublishSettings)
.dependsOn(
Expand Down Expand Up @@ -84,6 +84,7 @@ lazy val sbtDevOopsHttpCore = subProject(props.SubProjectNameHttpCore)
libs.newtype,
libs.effectie,
libs.justSysprocess,
libs.extrasCats,
) ++ libs.loggerF ++ libs.circe ++ libs.refined ++ libs.http4sClient ++ libs.javaxActivation212,
)
.dependsOn(sbtDevOopsCommon % props.IncludeTest)
Expand Down Expand Up @@ -126,7 +127,7 @@ lazy val sbtDevOopsJava = subProject(props.SubProjectNameJava)
lazy val mavenCentralPublishSettings: SettingsDefinition = List(
/* Publish to Maven Central { */
sonatypeCredentialHost := props.SonatypeCredentialHost,
sonatypeRepository := props.SonatypeRepository,
sonatypeRepository := props.SonatypeRepository,
/* } Publish to Maven Central */
)

Expand All @@ -138,27 +139,25 @@ def subProject(projectName: String): Project = {
val prefixedName = prefixedProjectName(projectName)
Project(projectName, file(s"modules/$prefixedName"))
.settings(
organization := props.Org,
name := prefixedName,
organization := props.Org,
name := prefixedName,
// scalacOptions ++= List("-Xsource:3"),
Compile / console / scalacOptions := scalacOptions.value diff List("-Ywarn-unused-import", "-Xfatal-warnings"),
Compile / compile / wartremoverErrors ++= commonWarts,
Test / compile / wartremoverErrors ++= commonWarts,
testFrameworks ~=
(frameworks => (TestFramework("hedgehog.sbt.Framework") +: frameworks).distinct),
licenses := List("MIT" -> url("http://opensource.org/licenses/MIT")),
publishMavenStyle := true,
coverageHighlighting := (CrossVersion.partialVersion(scalaVersion.value) match {
licenses := List("MIT" -> url("http://opensource.org/licenses/MIT")),
publishMavenStyle := true,
coverageHighlighting := (CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, 10)) =>
false
case _ =>
true
}),
scriptedLaunchOpts := {
scriptedLaunchOpts := {
scriptedLaunchOpts.value ++
Seq("-Xmx1024M", "-Dplugin.version=" + version.value)
},
scriptedBufferLog := false,
scriptedBufferLog := false,
)
.settings(mavenCentralPublishSettings)
}
Expand Down Expand Up @@ -198,21 +197,21 @@ lazy val props =

final val newtypeVersion = "0.4.4"

final val catsVersion = "2.9.0"
final val catsEffectVersion = "3.4.3"
final val catsVersion = "2.10.0"
final val catsEffectVersion = "3.5.2"

final val extrasVersion = "0.26.0"
final val extrasVersion = "0.44.0"

final val effectieVersion = "2.0.0-beta4"
final val loggerFVersion = "2.0.0-beta4"
final val effectieVersion = "2.0.0-beta13"
final val loggerFVersion = "2.0.0-beta22"

final val refinedVersion = "0.10.1"
final val refinedVersion = "0.11.0"

final val circeVersion = "0.14.3"
final val circeVersion = "0.14.6"

final val http4sVersion = "0.23.16"
final val http4sVersion = "0.23.24"

final val justSemVerVersion = "0.6.0"
final val justSemVerVersion = "0.13.0"

final val justSysprocessVersion = "1.0.0"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
package kevinlee.http;
package kevinlee.http

import cats.Monad
import cats.data.EitherT
import cats.effect.*
import cats.syntax.all.*
import devoops.data.DevOopsLogLevel
import effectie.core.*
import extras.cats.syntax.either.*
import extras.cats.syntax.all.*
import fs2.io.file.Files
import fs2.text
import io.circe.Decoder
import loggerf.syntax.all.*
import loggerf.core.*
import loggerf.instances.show.*
import org.http4s.Status.Successful
import loggerf.syntax.all.*
import org.http4s.*
import org.http4s.Status.Successful
import org.http4s.circe.CirceEntityCodec.*
import org.http4s.client.Client
import org.http4s.client.dsl.Http4sClientDsl
Expand All @@ -38,13 +39,13 @@ trait HttpClient[F[?]] {
object HttpClient {

def apply[
F[?]: Monad: Fx: Log: Async
F[?]: Monad: Fx: Log: Async: Files
](client: Client[F]): HttpClient[F] =
new HttpClientF[F](client)

@SuppressWarnings(Array("org.wartremover.warts.Any", "org.wartremover.warts.Nothing"))
final class HttpClientF[
F[?]: Monad: Fx: Log: Async
F[?]: Monad: Fx: Log: Async: Files
](
client: Client[F]
) extends HttpClient[F] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ object HttpRequest {
import org.http4s.dsl.request.*

@SuppressWarnings(Array("org.wartremover.warts.Any", "org.wartremover.warts.Nothing"))
def toHttp4s[F[?]: Applicative: Async: Http4sClientDsl](
def toHttp4s[F[?]: Applicative: Async: Http4sClientDsl: Files](
httpRequest: HttpRequest
): F[Either[HttpError, Request[F]]] =
httpRequest
Expand Down Expand Up @@ -403,7 +403,7 @@ object HttpRequest {
def withHeader(header: Header): HttpRequest =
httpRequest.copy(headers = httpRequest.headers :+ header)

def toHttp4s[F[?]: Applicative: Async: Http4sClientDsl]: F[Either[HttpError, Request[F]]] =
def toHttp4s[F[?]: Applicative: Async: Http4sClientDsl: Files]: F[Either[HttpError, Request[F]]] =
HttpRequest.toHttp4s[F](httpRequest)

// TODO: uncomment it once this issue is solved properly. https://github.com/http4s/http4s/issues/4303
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import effectie.syntax.all.*
import extras.cats.syntax.all.*
import extras.scala.io.Color
import extras.scala.io.syntax.color.*
import fs2.io.file.Files
import fs2.io.net.Network
import kevinlee.github.GitHubApi
import kevinlee.github.data.GitHub
import kevinlee.http.HttpClient
Expand Down Expand Up @@ -205,7 +207,7 @@ object DevOopsStarterPlugin extends AutoPlugin {
},
)

def writeDefaultScalafmtConf[F[?]: Fx: LogF: Async](dialectVersion: String, outFile: File)(
def writeDefaultScalafmtConf[F[?]: Fx: LogF: Async: Network: Files](dialectVersion: String, outFile: File)(
implicit LV: DevOopsLogLevel
): F[Either[StarterError, Unit]] =
EmberClientBuilder
Expand Down

0 comments on commit e719861

Please sign in to comment.