Skip to content

Commit

Permalink
Merge pull request #312 from Kevin-Lee/task/311/bump-scala2
Browse files Browse the repository at this point in the history
Close #311 - Bump Scala 2 and libraries
  • Loading branch information
kevin-lee authored Oct 12, 2022
2 parents 79e490e + 33a13d6 commit a9a79dc
Show file tree
Hide file tree
Showing 28 changed files with 113 additions and 104 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:
strategy:
matrix:
scala:
- { name: "Scala 2", version: "2.12.14", binary-version: "2.12", java-version: "[email protected]", report: "" }
- { name: "Scala 2", version: "2.13.6", binary-version: "2.13", java-version: "[email protected]", report: "report" }
- { name: "Scala 2", version: "2.12.17", binary-version: "2.12", java-version: "[email protected]", report: "" }
- { name: "Scala 2", version: "2.13.10", binary-version: "2.13", java-version: "[email protected]", report: "report" }
- { name: "Scala 3", version: "3.1.2", binary-version: "3", java-version: "[email protected]", report: "" }

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/doc-site-build-only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
scala:
- { version: "2.13.6", binary-version: "2.13", java-version: "11" }
- { version: "2.13.10", binary-version: "2.13", java-version: "11" }

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/doc-site-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
matrix:
scala:
- { version: "2.13.6", binary-version: "2.13", java-version: "11" }
- { version: "2.13.10", binary-version: "2.13", java-version: "11" }

steps:
- uses: actions/checkout@v2
Expand Down
57 changes: 31 additions & 26 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,12 @@ lazy val core = subProject("core")
else
List(libs.newTypeLib, libs.catsLib, libs.scalaXmlLatest)
},
libraryDependencies ++= Seq(
libs.effectieCatsEffect,
) ++ List(libs.extrasCats),
libraryDependencies ++= List(
libs.effectieCore,
libs.effectieSyntax,
libs.effectieCatsEffect2,
libs.extrasCats,
),
libraryDependencies := libraryDependenciesPostProcess(scalaVersion.value, libraryDependencies.value),
wartremoverExcluded ++= List(sourceManaged.value),
/* Build Info { */
Expand Down Expand Up @@ -102,36 +105,37 @@ def prefixedProjectName(name: String) =
val removeDottyIncompatible: ModuleID => Boolean =
m =>
// m.name == "wartremover" ||
m.name == "ammonite" ||
m.name == "ammonite" ||
m.name == "kind-projector" ||
m.name == "mdoc" ||
m.name == "better-monadic-for"

lazy val props =
new {

final val GitHubUsername = "Kevin-Lee"
final val RepoName = "maven2sbt"
final val ExecutableScriptName = RepoName
val GitHubUsername = "Kevin-Lee"
val RepoName = "maven2sbt"
val ExecutableScriptName = RepoName

final val DottyVersion = "3.1.2"
// final val ProjectScalaVersion = "2.13.5"
final val ProjectScalaVersion = DottyVersion
final val CrossScalaVersions = List("2.12.14", "2.13.6", ProjectScalaVersion, DottyVersion).distinct
val Scala2Version = "2.13.10"
val DottyVersion = "3.1.2"
val CrossScalaVersions = List("2.12.17", Scala2Version, DottyVersion).distinct
val ProjectScalaVersion = Scala2Version

final val hedgehogVersion = "0.8.0"
val hedgehogVersion = "0.9.0"

// final val canEqualVersion = "0.1.0"
// val canEqualVersion = "0.1.0"

final val EffectieVersion = "1.16.0"
val EffectieVersion = "2.0.0-beta2"
val LoggerFVersion = "2.0.0-beta2"

final val pirateVersion = "4e8177ec1548780cbf62b0352e58bceb7a99bfd6"
final val pirateUri = uri(s"https://github.com/$GitHubUsername/pirate.git#$pirateVersion")
val pirateVersion = "4e8177ec1548780cbf62b0352e58bceb7a99bfd6"
val pirateUri = uri(s"https://github.com/$GitHubUsername/pirate.git#$pirateVersion")

final val scalaXml1 = "1.3.0"
final val scalaXml2 = "2.1.0"
val scalaXml1 = "1.3.0"
val scalaXml2 = "2.1.0"

final val ExtrasVersion = "0.13.0"
val ExtrasVersion = "0.20.0"

}

Expand All @@ -148,14 +152,15 @@ lazy val libs =
lazy val scalaXmlLatest = "org.scala-lang.modules" %% "scala-xml" % props.scalaXml2
lazy val scalaXml = "org.scala-lang.modules" %% "scala-xml" % props.scalaXml1

lazy val catsLib = "org.typelevel" %% "cats-core" % "2.7.0"
lazy val catsLib = "org.typelevel" %% "cats-core" % "2.8.0"
lazy val cats_2_0_0 = "org.typelevel" %% "cats-core" % "2.0.0"

lazy val catsEffectLib = "org.typelevel" %% "cats-effect" % "2.5.4"
lazy val catsEffectLib = "org.typelevel" %% "cats-effect" % "2.5.5"
lazy val catsEffect_2_0_0 = "org.typelevel" %% "cats-effect" % "2.0.0"

lazy val effectieCatsEffect = "io.kevinlee" %% "effectie-cats-effect" % props.EffectieVersion
lazy val effectieScalazEffect = "io.kevinlee" %% "effectie-scalaz-effect" % props.EffectieVersion
lazy val effectieCore = "io.kevinlee" %% "effectie-core" % props.EffectieVersion
lazy val effectieSyntax = "io.kevinlee" %% "effectie-syntax" % props.EffectieVersion
lazy val effectieCatsEffect2 = "io.kevinlee" %% "effectie-cats-effect2" % props.EffectieVersion

lazy val newTypeLib = "io.estatico" %% "newtype" % "0.4.4"

Expand Down Expand Up @@ -193,17 +198,17 @@ def scalacOptionsPostProcess(scalaVersion: String, options: Seq[String]): Seq[St
"./dotty-docs",
) ++ options
} else {
options
"-Xsource:3" +: options
}

def subProject(projectName: String): Project = {
val prefixedName = prefixedProjectName(projectName)
Project(projectName, file(s"modules/$prefixedName"))
.settings(
name := prefixedName,
name := prefixedName,
testFrameworks ++= Seq(TestFramework("hedgehog.sbt.Framework")),
libraryDependencies ++= libs.hedgehogLibs,
scalacOptions := scalacOptionsPostProcess(scalaVersion.value, scalacOptions.value).distinct,
scalacOptions := scalacOptionsPostProcess(scalaVersion.value, scalacOptions.value).distinct,
Compile / unmanagedSourceDirectories ++= {
val sharedSourceDir = baseDirectory.value / "src/main"
if (scalaVersion.value.startsWith("2."))
Expand Down
10 changes: 6 additions & 4 deletions modules/maven2sbt-cli/src/main/scala/maven2sbt/cli/MainIo.scala
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package maven2sbt.cli

import cats.effect._
import effectie.cats.ConsoleEffect
import cats.effect.*
import effectie.core.ConsoleEffect
import effectie.ce2.fx.ioFx
import effectie.syntax.all.consoleEffectF
import maven2sbt.core.Maven2SbtError
import pirate.{ExitCode => PirateExitCode, _}
import scalaz._
import pirate.{ExitCode as PirateExitCode, *}
import scalaz.*

/** @author Kevin Lee
* @since 2019-12-09
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package maven2sbt.cli

import cats.effect._
import cats.syntax.all._
import effectie.cats.ConsoleEffect
import extras.cats.syntax.all._
import cats.effect.*
import cats.syntax.all.*
import effectie.core.*
import effectie.ce2.fx.ioFx
import effectie.syntax.console.consoleEffectF
import extras.cats.syntax.all.*
import maven2sbt.core.{BuildSbt, Maven2Sbt, Maven2SbtError}
import pirate._
import piratex._
import pirate.*
import piratex.*

import java.io.{BufferedWriter, File, FileWriter}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package maven2sbt.cli

import scalaz._
import Scalaz._
import pirate._
import Pirate._
import scalaz.*
import Scalaz.*
import pirate.*
import Pirate.*
import maven2sbt.core.{Libs, Props, ScalaBinaryVersion, ScalaVersion}
import maven2sbt.info.Maven2SbtBuildInfo

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package maven2sbt.core

import cats.Show
import cats.syntax.all._
import cats.syntax.all.*
import io.estatico.newtype.macros.newtype


Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package maven2sbt

import cats._
import io.estatico.newtype.macros._
import io.estatico.newtype.ops._
import cats.*
import io.estatico.newtype.macros.*
import io.estatico.newtype.ops.*
import just.fp.Named


Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package maven2sbt.core

import BuildSbt._
import cats.syntax.all._
import BuildSbt.*
import cats.syntax.all.*
import just.fp.Named

/** @author Kevin Lee
Expand All @@ -16,7 +16,7 @@ final case class BuildSbt(
)

object BuildSbt {
import StringUtils._
import StringUtils.*

final case class Settings(
groupId: Option[GroupId],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package maven2sbt.core

import cats.Show
import cats.syntax.all._
import cats.syntax.all.*
import just.fp.Named

import scala.language.postfixOps
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package maven2sbt.core

import StringUtils._
import cats._
import cats.syntax.show._
import StringUtils.*
import cats.*
import cats.syntax.show.*

/** @author Kevin Lee
* @since 2019-04-22
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package maven2sbt.core

import cats.Show
import cats.syntax.show._
import cats.syntax.show.*

import scala.xml.Node

import Libs._
import Libs.*

/** @author Kevin Lee
* @since 2021-03-10
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
package maven2sbt.core

import cats._
import cats.syntax.all._

import effectie.cats.Effectful._
import effectie.cats._

import extras.cats.syntax.all._
import cats.*
import cats.syntax.all.*
import effectie.core.*
import effectie.syntax.fx.*
import extras.cats.syntax.all.*

import java.io.{File, InputStream}
import scala.xml._
import scala.xml.*

/** @author Kevin Lee
* @since 2017-04-03
Expand Down Expand Up @@ -103,6 +101,8 @@ object Maven2Sbt {
): F[Either[Maven2SbtError, BuildSbt]] =
(for {
pomFile <- Option(file).filter(_.exists()).toRight(Maven2SbtError.pomFileNotExist(file)).eitherT[F]
// mavenXpp3Reader = new MavenXpp3Reader()
// pomElem <- effectOf(mavenXpp3Reader.read(new FileReader((pomFile)))).rightT
pomElem <- effectOf(XML.loadFile(pomFile)).rightT
buildSbtString <- buildSbt(scalaVersion, propsName, scalaBinaryVersionName, pomElem).eitherT
} yield buildSbtString).value
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package maven2sbt.core

import cats.syntax.all._
import hedgehog._
import hedgehog.runner._
import cats.syntax.all.*
import hedgehog.*
import hedgehog.runner.*

/** @author Kevin Lee
* @since 2020-09-05
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package maven2sbt.core

import cats.syntax.all._
import hedgehog._
import hedgehog.runner._
import cats.syntax.all.*
import hedgehog.*
import hedgehog.runner.*

import scala.xml.Elem

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package maven2sbt.core

import hedgehog._
import hedgehog.runner._
import hedgehog.*
import hedgehog.runner.*

/** @author Kevin Lee
* @since 2019-04-22
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package maven2sbt.core

import hedgehog._
import cats.syntax.all._
import hedgehog.*
import cats.syntax.all.*
import maven2sbt.core.Repository.{RepoId, RepoName, RepoUrl}
import maven2sbt.core.{Prop => M2sProp}
import maven2sbt.core.Prop as M2sProp

import scala.util.Random

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package maven2sbt.core

import cats.syntax.all._
import hedgehog._
import hedgehog.runner._
import cats.syntax.all.*
import hedgehog.*
import hedgehog.runner.*

import scala.xml.Elem

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package maven2sbt.core

import hedgehog._
import hedgehog.runner._
import hedgehog.*
import hedgehog.runner.*

import scala.xml.{Elem, Null, Text, TopScope}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package maven2sbt.core

import hedgehog._
import hedgehog.runner._
import hedgehog.*
import hedgehog.runner.*

import scala.xml._
import scala.xml.*

/** @author Kevin Lee
* @since 2019-04-22
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package maven2sbt.core

import hedgehog._
import hedgehog.runner._
import maven2sbt.core.{Prop => M2sProp}
import hedgehog.*
import hedgehog.runner.*
import maven2sbt.core.Prop as M2sProp

object PropSpec extends Properties {

Expand Down
Loading

0 comments on commit a9a79dc

Please sign in to comment.