From ee96a27f766fae7e0e20036c74b6abafe5927a1a Mon Sep 17 00:00:00 2001 From: Barry O'Neill Date: Tue, 26 Nov 2024 16:25:01 -0500 Subject: [PATCH] use laserdisc defaults --- .gitignore | 43 +++++++++++++++++++++-- .scalafmt.conf | 17 +++++++-- build.sbt | 72 +++++--------------------------------- project/Dependencies.scala | 2 +- project/build.properties | 14 +++++++- project/plugins.sbt | 8 ++--- 6 files changed, 82 insertions(+), 74 deletions(-) diff --git a/.gitignore b/.gitignore index fdc93b2..373499d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,42 @@ -.idea/ +# ------------------ autogenerated file - do not edit ------------------- +# This file was generated by sbt-laserdisc-defaults +# +# Please check in any changes generated in this file (for IDE support) +# +# To make changes, please publish a new version of the plugin at: +# https://github.com/laserdisc-io/sbt-laserdisc-defaults +# +# To temporarily disable generation, set this at the top of build.sbt: +# ThisBuild / laserdiscGitIgnoreGenOn := false +# ----------------------------------------------------------------------- + +# tip: use a "global" gitignore (core.excludesfile) for your own, local, personal preferences +# See: https://gist.github.com/subfuzion/db7f57fff2fb6998a16c + +# scala / sbt / java +project/project/ +project/target/ target/ -.cache +.sbtopts +.tasty + +# intellij +.idea/ +*.iml + +# metals / bsp +.metals/ +.bloop/ .bsp/ -.DS_Store +project/metals.sbt + +# vscode +.vscode/ + +# terraform +.terraform/ +*.tfplan +*.terraform.lock.hcl + +# mac +.DS_Store \ No newline at end of file diff --git a/.scalafmt.conf b/.scalafmt.conf index 8d8e3c6..34ae598 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,12 +1,25 @@ +# ------------------ autogenerated file - do not edit ------------------- +# This file was generated by sbt-laserdisc-defaults +# +# Please check in any changes generated in this file (for IDE support) +# +# To make changes, please publish a new version of the plugin at: +# https://github.com/laserdisc-io/sbt-laserdisc-defaults +# +# To temporarily disable generation, set this at the top of build.sbt: +# ThisBuild / laserdiscScalaFmtGenOn := false +# ----------------------------------------------------------------------- + version=3.8.3 maxColumn = 140 style = default align.preset = more -runner.dialect = scala213source3 +project.layout = StandardConvention +runner.dialect = scala3 fileOverride { - "glob:**/scala-3/**" { runner.dialect = scala3 } + "lang:scala-2" = scala213source3 } danglingParentheses.preset = true diff --git a/build.sbt b/build.sbt index 6a5680e..a392c97 100644 --- a/build.sbt +++ b/build.sbt @@ -1,72 +1,18 @@ -lazy val scala213 = "2.13.15" -lazy val scala3 = "3.3.4" +import laserdisc.sbt.CompileTarget.Scala2And3 +import laserdisc.sbt.LaserDiscDevelopers.* + +ThisBuild / laserdiscRepoName := "scanamo-circe" +ThisBuild / laserdiscCompileTarget := Scala2And3 lazy val root = project .in(file(".")) .settings( - name := "scanamo-circe", - organization := "io.laserdisc", - crossScalaVersions := List(scala213, scala3), - scalaVersion := scala3, - licenses ++= Seq(("MIT", url("http://opensource.org/licenses/MIT"))), - homepage := Some(url("https://github.com/laserdisc-io/scanamo-circe")), - developers := List( - Developer("semenodm", "Dmytro Semenov", "", url("https://github.com/semenodm")), - Developer("barryoneill", "Barry O'Neill", "", url("https://github.com/barryoneill")) - ), - Test / fork := true, - scalacOptions ++= Seq( - "-deprecation", - "-encoding", - "UTF-8", - "-feature", - "-language:existentials,experimental.macros,higherKinds,implicitConversions,postfixOps", - "-unchecked", - "-Xfatal-warnings" - ), - scalacOptions ++= { - CrossVersion.partialVersion(scalaVersion.value) match { - case Some((2, minor)) if minor >= 13 => - Seq( - "-Xlint:-unused,_", - "-Ywarn-numeric-widen", - "-Ywarn-value-discard", - "-Ywarn-unused:implicits", - "-Ywarn-unused:imports", - "-Xsource:3", - "-Xlint:-byname-implicit", - "-P:kind-projector:underscore-placeholders", - "-Xlint", - "-Ywarn-macros:after" - ) - case _ => Seq.empty - } - }, - scalacOptions ++= { - CrossVersion.partialVersion(scalaVersion.value) match { - case Some((3, _)) => - Seq( - "-Ykind-projector:underscores", - "-source:future", - "-language:adhocExtensions", - "-Wconf:msg=`= _` has been deprecated; use `= uninitialized` instead.:s" - ) - case _ => Seq.empty - } - }, - sbt.Test / testFrameworks += TestFrameworks.ScalaCheck, - libraryDependencies ++= Seq( - compilerPlugin(("org.typelevel" %% "kind-projector" % "0.13.3").cross(CrossVersion.full)), - compilerPlugin("com.olegpy" %% "better-monadic-for" % "0.3.1") - ).filterNot(_ => scalaVersion.value.startsWith("3.")), + name := "scanamo-circe", + developers := List(Dmytro, Barry), Dependencies.Compat, Dependencies.Circe, Dependencies.Scanamo, Dependencies.ScalaTest, - Dependencies.scalacheck, - addCommandAlias("format", ";scalafmtAll;scalafmtSbt"), - addCommandAlias("checkFormat", ";scalafmtCheckAll;scalafmtCheck"), - addCommandAlias("build", ";checkFormat;clean;test;coverage"), - addCommandAlias("release", ";checkFormat;clean;test;coverage;release") + Dependencies.scalacheck ) - .enablePlugins(ScalafmtPlugin) + .enablePlugins(LaserDiscDefaultsPlugin) diff --git a/project/Dependencies.scala b/project/Dependencies.scala index d81f556..8129d64 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -6,7 +6,7 @@ object Dependencies { val Compat = libraryDependencies += "org.scala-lang.modules" %% "scala-collection-compat" % "2.12.0" val Circe = libraryDependencies += "io.circe" %% "circe-parser" % "0.14.10" - val Scanamo = libraryDependencies += "org.scanamo" %% "scanamo" % "2.0.0" + val Scanamo = libraryDependencies += "org.scanamo" %% "scanamo" % "3.0.0" val ScalaTest = libraryDependencies += "org.scalatest" %% "scalatest" % "3.2.19" % "test" val scalacheck = libraryDependencies += "org.scalacheck" %% "scalacheck" % "1.18.1" % "test" } diff --git a/project/build.properties b/project/build.properties index 0b699c3..8bfed43 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1,13 @@ -sbt.version=1.10.2 +# ------------------ autogenerated file - do not edit ------------------- +# This file was generated by sbt-laserdisc-defaults +# +# Please check in any changes generated in this file (for IDE support) +# +# To make changes, please publish a new version of the plugin at: +# https://github.com/laserdisc-io/sbt-laserdisc-defaults +# +# To temporarily disable generation, set this at the top of build.sbt: +# ThisBuild / laserdiscSBTVersionGenOn := false +# ----------------------------------------------------------------------- + +sbt.version = 1.10.5 \ No newline at end of file diff --git a/project/plugins.sbt b/project/plugins.sbt index 51dc1c7..0cf5732 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,4 +1,4 @@ -addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2") -addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.5") -addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.3.2") -addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12") +addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.3.11") +addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.2.2") +addSbtPlugin("io.laserdisc" % "sbt-laserdisc-defaults" % "0.2.0") +addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.9.0")