Skip to content

Commit

Permalink
Make tlPrePrBotHook a task
Browse files Browse the repository at this point in the history
  • Loading branch information
armanbilge committed Jan 29, 2022
1 parent 4b52ef7 commit 5d4ae38
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions core/src/main/scala/org/typelevel/sbt/TypelevelPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import sbt._, Keys._
import org.typelevel.sbt.gha.GenerativePlugin
import org.typelevel.sbt.gha.GitHubActionsPlugin
import de.heikoseeberger.sbtheader.HeaderPlugin
import org.scalafmt.sbt.ScalafmtPlugin

import scala.collection.immutable

Expand All @@ -30,13 +31,17 @@ object TypelevelPlugin extends AutoPlugin {
TypelevelSettingsPlugin &&
TypelevelCiReleasePlugin &&
GitHubActionsPlugin &&
HeaderPlugin
HeaderPlugin &&
ScalafmtPlugin

override def trigger = allRequirements

object autoImport {
lazy val tlFatalWarningsInCi = settingKey[Boolean](
"Convert compiler warnings into errors under CI builds (default: true)")

lazy val tlPrePrBotHook =
taskKey[Unit]("A hook for bots like Scala Steward to run prePR commands")
}

import autoImport._
Expand All @@ -45,6 +50,8 @@ object TypelevelPlugin extends AutoPlugin {
import TypelevelSonatypeCiReleasePlugin.autoImport._
import GenerativePlugin.autoImport._
import GitHubActionsPlugin.autoImport._
import HeaderPlugin.autoImport._
import ScalafmtPlugin.autoImport._

override def globalSettings = Seq(
tlFatalWarningsInCi := true
Expand Down Expand Up @@ -99,8 +106,17 @@ object TypelevelPlugin extends AutoPlugin {
)
)

// override for bincompat
override def projectSettings = immutable.Seq.empty
// immutable.Seq for bincompat
override def projectSettings = immutable.Seq(
tlPrePrBotHook := Def
.sequential(
githubWorkflowGenerate,
headerCreateAll,
scalafmtAll,
scalafmtSbt
)
.value
)

private val primaryJavaCond = Def.setting {
val java = githubWorkflowJavaVersions.value.head
Expand Down

0 comments on commit 5d4ae38

Please sign in to comment.