Skip to content

Commit

Permalink
Merge pull request #217 from laserdisc-io/use-plugin
Browse files Browse the repository at this point in the history
use the laserdisc plugin
  • Loading branch information
barryoneill authored Nov 15, 2024
2 parents 0c2e0a2 + ce3d472 commit 828821c
Show file tree
Hide file tree
Showing 8 changed files with 101 additions and 122 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,24 @@ jobs:
strategy:
matrix:
scala:
- 2.13.11
- 3.3.0
- 2.13.15
- 3.3.4
java:
- [email protected]
- [email protected]
os:
- ubuntu-22.04
runs-on: ${{ matrix.os }}
steps:
- name: Branch Checkout
uses: actions/checkout@v2.5.0
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Java And Sbt
uses: olafurpg/setup-scala@v13
uses: olafurpg/setup-scala@v14
with:
java-version: ${{ matrix.java }}
- name: Cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: |
$HOME/.cache/coursier
Expand All @@ -42,7 +41,7 @@ jobs:
project/target
key: ${{ runner.os }}-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
- name: Test (${{ matrix.scala }}, ${{ matrix.java }})
run: sbt ++${{ matrix.scala }} fullTest
run: sbt ++${{ matrix.scala }} build
- name: Upload To Codecov
uses: codecov/codecov-action@v2

6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ on:
tags: ["*"]
jobs:
publish:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
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
- run: sbt ci-release
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
Expand Down
41 changes: 37 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,42 @@
.terraform/
# ------------------ 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/
.sbtopts
.tasty

# intellij
.idea/
.idea/*
*.iml

# metals / bsp
.metals/
.bloop/
.bsp/
.jvmopts
.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
84 changes: 8 additions & 76 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,79 +1,14 @@
lazy val scala213 = "2.13.15"
lazy val scala3 = "3.3.4"
lazy val supportedScalaVersions = List(scala213, scala3)
ThisBuild / crossScalaVersions := supportedScalaVersions
ThisBuild / scalaVersion := scala213
import laserdisc.sbt.CompileTarget.Scala2And3
import laserdisc.sbt.LaserDiscDevelopers.Barry

lazy val publishSettings = Seq(
Test / publishArtifact := false,
pomIncludeRepository := (_ => false),
organization := "io.laserdisc",
homepage := Some(url("http://laserdisc.io/slack4s")),
developers := List(
Developer("barryoneill", "Barry O'Neill", "", url("https://github.com/barryoneill"))
),
scmInfo := Some(
ScmInfo(
url("https://github.com/laserdisc-io/slack4s/tree/master"),
"scm:git:[email protected]:laserdisc-io/slack4s.git"
)
),
licenses := Seq(
"MIT" -> url("https://raw.githubusercontent.com/laserdisc-io/slack4s/master/LICENSE")
)
)
ThisBuild / laserdiscRepoName := "slack4s"
ThisBuild / laserdiscCompileTarget := Scala2And3

lazy val root = project
.in(file("."))
.settings(
name := "slack4s",
publishSettings,
Seq(
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.")),
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
}
}
),
Test / fork := true,
name := "slack4s",
developers := List(Barry),
// ------------------------- deps -------------------------
excludeDependencies += "commons-logging",
Dependencies.TestLib,
Expand All @@ -85,9 +20,6 @@ lazy val root = project
Dependencies.Slack,
// ------------------ version fmt + buildinfo ------------------
buildInfoKeys := Seq[BuildInfoKey](name, version, scalaVersion, sbtVersion),
buildInfoPackage := "slack4s",
addCommandAlias("format", ";scalafmtAll;scalafmtSbt"),
addCommandAlias("checkFormat", ";scalafmtCheckAll;scalafmtSbtCheck"),
addCommandAlias("fullTest", ";clean;checkFormat;test")
buildInfoPackage := "slack4s"
)
.enablePlugins(BuildInfoPlugin, GitVersioning)
.enablePlugins(BuildInfoPlugin, LaserDiscDefaultsPlugin)
40 changes: 15 additions & 25 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,48 +8,38 @@ object Dependencies {
testFrameworks += new TestFramework("munit.Framework"),
libraryDependencies ++= Seq(
"org.scalameta" %% "munit" % "1.0.2",
"org.mockito" % "mockito-core" % "5.14.1",
"org.mockito" % "mockito-core" % "5.14.2",
"org.gnieh" %% "diffson-circe" % "4.6.0"
).map(_ % Test)
)

val Slack = Seq(
libraryDependencies += "com.slack.api" % "slack-app-backend" % "1.43.1"
)
val Slack = libraryDependencies += "com.slack.api" % "slack-app-backend" % "1.44.1"

val Refined = Seq(
libraryDependencies += "eu.timepit" %% "refined" % "0.11.2"
)
val Refined = libraryDependencies += "eu.timepit" %% "refined" % "0.11.2"

val NewTypes = Seq(
libraryDependencies += "io.monix" %% "newtypes-core" % "0.3.0"
)
val NewTypes = libraryDependencies += "io.monix" %% "newtypes-core" % "0.3.0"

val Logging = Seq(
libraryDependencies ++= Seq(
"org.typelevel" %% "log4cats-slf4j" % "2.7.0",
"ch.qos.logback" % "logback-classic" % "1.5.9" % Test,
"ch.qos.logback" % "logback-core" % "1.5.9" % Test,
"ch.qos.logback" % "logback-classic" % "1.5.12" % Test,
"ch.qos.logback" % "logback-core" % "1.5.12" % Test,
"org.slf4j" % "jcl-over-slf4j" % "2.0.16" % Test,
"org.slf4j" % "jul-to-slf4j" % "2.0.16" % Test
)
)

val Http4s = Seq(
libraryDependencies ++= Seq(
"org.http4s" %% "http4s-dsl",
"org.http4s" %% "http4s-ember-server",
"org.http4s" %% "http4s-ember-client",
"org.http4s" %% "http4s-circe"
).map(_ % "0.23.28")
)
val Http4s = libraryDependencies ++= Seq(
"http4s-dsl",
"http4s-ember-server",
"http4s-ember-client",
"http4s-circe"
).map("org.http4s" %% _ % "0.23.29")

val CirceVersion = "0.14.10"
val Circe = Seq(
libraryDependencies ++= Seq(
"io.circe" %% "circe-core" % CirceVersion,
"io.circe" %% "circe-parser" % CirceVersion
)
val Circe = libraryDependencies ++= Seq(
"io.circe" %% "circe-core" % CirceVersion,
"io.circe" %% "circe-parser" % CirceVersion
)

}
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("com.eed3si9n" % "sbt-buildinfo" % "0.12.0")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.11")
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.7.0")
addSbtPlugin("io.laserdisc" % "sbt-laserdisc-defaults" % "0.1.1")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.13.1")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.12")
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.9.0")

0 comments on commit 828821c

Please sign in to comment.