Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use laserdisc defaults #10

Merged
merged 2 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
name: Build

name: CI
on:
pull_request:
branches: [ main ]
branches: ['*']
push:
branches: [ main ]

branches: [main]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK
uses: olafurpg/setup-scala@v10
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Java And Sbt
uses: olafurpg/setup-scala@v14
with:
java-version: [email protected]
- name: Cache SBT
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: |
~/.cache/coursier/v1
~/.sbt
key: sbt-${{ hashFiles('**/build.sbt') }}
- name: Run tests
run: sbt +clean +test +doc
run: sbt build

8 changes: 5 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ on:
tags: ["*"]
jobs:
publish:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.4
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: olafurpg/setup-scala@v10
- uses: olafurpg/setup-scala@v14
with:
java-version: [email protected]
- run: sbt ci-release
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
Expand Down
43 changes: 40 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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
17 changes: 15 additions & 2 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -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
Expand Down
72 changes: 9 additions & 63 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 1 addition & 1 deletion project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
14 changes: 13 additions & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -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
8 changes: 4 additions & 4 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -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")