Skip to content

Commit

Permalink
Merge pull request #133 from ahjohannessen/wip-revert-usage-of-spiewak
Browse files Browse the repository at this point in the history
build: revert usage of sbt-spiewak
  • Loading branch information
ahjohannessen authored Sep 1, 2020
2 parents a5a48e2 + 974203c commit 465c0c1
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 31 deletions.
67 changes: 43 additions & 24 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -59,35 +59,57 @@ lazy val demo = project

// General Settings

lazy val commonSettings = Seq(
Compile / scalacOptions ~= devScalacOptions,
Test / scalacOptions ~= devScalacOptions,
IntegrationTest / scalacOptions ~= devScalacOptions,
libraryDependencies ++=
testM(catsLaws, disciplineSpecs2, specs2, specs2ScalaCheck).map(_.withDottyCompat(scalaVersion.value))
)

lazy val metalsEnabled =
scala.util.Properties.envOrElse("METALS_ENABLED", "false").toBoolean

val devScalacOptions = { options: Seq[String] =>
if (metalsEnabled)
options.filterNot(Set("-Wunused:locals", "-Wunused:params", "-Wunused:imports", "-Wunused:privates"))
else options
}
lazy val commonSettings =
AutomateHeaderPlugin.projectSettings ++
Seq(
scalacOptions ++= {
if (isDotty.value) Seq("-source:3.0-migration") else Nil
},
libraryDependencies ++=
testM(catsLaws, disciplineSpecs2, specs2, specs2ScalaCheck).map(_.withDottyCompat(scalaVersion.value)),
pomPostProcess := { node =>
import scala.xml._
import scala.xml.transform._
def stripIf(f: Node => Boolean) = new RewriteRule {
override def transform(n: Node) = if (f(n)) NodeSeq.Empty else n
}
val stripTestScope = stripIf(n => n.label == "dependency" && (n \ "scope").text == "test")
new RuleTransformer(stripTestScope).transform(node)(0)
},
Compile / doc / sources := {
val old = (Compile / doc / sources).value
if (isDotty.value) Nil else old
}
)

inThisBuild(
List(
baseVersion := "0.0.1",
scalaVersion := crossScalaVersions.value.last,
crossScalaVersions := Seq("0.27.0-RC1", "2.13.3"),
scalacOptions ++= Seq("-target:jvm-1.8"),
javacOptions ++= Seq("-target", "8", "-source", "8"),
organization := "io.github.ahjohannessen",
publishGithubUser := "ahjohannessen",
publishFullName := "Alex Henning Johannessen",
organizationName := "Alex Henning Johannessen",
homepage := Some(url("https://github.com/ahjohannessen/sec")),
scmInfo := Some(ScmInfo(url("https://github.com/ahjohannessen/sec"), "[email protected]:ahjohannessen/sec.git")),
shellPrompt := Prompt.enrichedShellPrompt
startYear := Some(2020),
licenses += (("Apache-2.0", url("http://www.apache.org/licenses/"))),
developers := List(
Developer(
"ahjohannessen",
"Alex Henning Johannessen",
"[email protected]",
url("https://github.com/ahjohannessen")
)),
shellPrompt := Prompt.enrichedShellPrompt,
pomIncludeRepository := { _ => false },
scalacOptions in (Compile, doc) ++= Seq(
"-groups",
"-sourcepath",
(baseDirectory in LocalRootProject).value.getAbsolutePath,
"-doc-source-url",
"https://github.com/ahjohannessen/sec/blob/v" + version.value + "€{FILE_PATH}.scala"
)
)
)

Expand Down Expand Up @@ -124,10 +146,7 @@ inThisBuild(
commands = List(".docker/single-node.sh down", ".docker/cluster.sh down"),
cond = Some("always()")
),
githubWorkflowPublishTargetBranches := Seq(
RefPredicate.Equals(Ref.Branch("master")),
RefPredicate.StartsWith(Ref.Tag("v"))
),
githubWorkflowPublishTargetBranches += RefPredicate.StartsWith(Ref.Tag("v")),
githubWorkflowPublishPreamble +=
WorkflowStep.Use("olafurpg", "setup-gpg", "v2"),
githubWorkflowPublish := Seq(
Expand Down
16 changes: 9 additions & 7 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "0.4.2")
addSbtPlugin("com.codecommit" % "sbt-spiewak" % "0.15.2")
addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.3")
addSbtPlugin("org.lyranthe.fs2-grpc" % "sbt-java-gen" % "0.7.3")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.2")
addSbtPlugin("io.spray" % "sbt-revolver" % "0.9.1")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.10.0")
addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "0.4.2")
addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.13")
addSbtPlugin("com.codecommit" % "sbt-github-actions" % "0.9.2")
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.6.0")
addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.3")
addSbtPlugin("org.lyranthe.fs2-grpc" % "sbt-java-gen" % "0.7.3")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.2")
addSbtPlugin("io.spray" % "sbt-revolver" % "0.9.1")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.10.0")

0 comments on commit 465c0c1

Please sign in to comment.