Skip to content

Commit

Permalink
updating to new SBT syntax (#425)
Browse files Browse the repository at this point in the history
  • Loading branch information
barkhorn authored Dec 18, 2021
1 parent 1ced550 commit 443eacf
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
20 changes: 10 additions & 10 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import sbtcrossproject.CrossPlugin.autoImport.crossProject

scalaVersion in ThisBuild := "2.11.12"
crossScalaVersions in ThisBuild := Seq("2.11.12", "2.12.15", "2.13.7")
//scalaJSUseRhino in ThisBuild := true
ThisBuild / scalaVersion := "2.11.12"
ThisBuild / crossScalaVersions := Seq("2.11.12", "2.12.15", "2.13.7")
//ThisBuild / scalaJSUseRhino := true

lazy val scalatest = Def.setting("org.scalatest" %%% "scalatest" % "3.2.10")
lazy val specs2 = Def.setting("org.specs2" %%% "specs2-core" % "4.10.6")

val commonSettings = Defaults.coreDefaultSettings ++ Seq(
unmanagedSourceDirectories in Compile ++= {
Compile / unmanagedSourceDirectories ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2L, minor)) =>
Some(baseDirectory.value.getParentFile / s"shared/src/main/scala-2.$minor")
Expand All @@ -22,11 +22,11 @@ val commonSettings = Defaults.coreDefaultSettings ++ Seq(
lazy val scalamock = crossProject(JSPlatform, JVMPlatform) in file(".") settings(
commonSettings,
name := "scalamock",
publishArtifact in (Compile, packageBin) := true,
publishArtifact in (Compile, packageDoc) := true,
publishArtifact in (Compile, packageSrc) := true,
publishArtifact in Test := false,
scalacOptions in (Compile, doc) ++= Opts.doc.title("ScalaMock") ++
Compile / packageBin / publishArtifact := true,
Compile / packageDoc / publishArtifact := true,
Compile / packageSrc / publishArtifact := true,
Test / publishArtifact := false,
Compile / doc / scalacOptions ++= Opts.doc.title("ScalaMock") ++
Opts.doc.version(version.value) ++ Seq("-doc-root-content", "rootdoc.txt", "-version"),
libraryDependencies ++= Seq(
"org.scala-lang" % "scala-reflect" % scalaVersion.value,
Expand All @@ -41,7 +41,7 @@ lazy val `scalamock-jvm` = scalamock.jvm
lazy val examples = project in file("examples") settings(
commonSettings,
name := "ScalaMock Examples",
skip in publish := true,
publish / skip := true,
libraryDependencies ++= Seq(
scalatest.value % Test,
specs2.value % Test
Expand Down
22 changes: 11 additions & 11 deletions publishing.sbt
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
organization in ThisBuild := "org.scalamock"
licenses in ThisBuild := Seq("MIT" -> url("https://opensource.org/licenses/MIT"))
scmInfo in ThisBuild := Some(
ThisBuild / organization := "org.scalamock"
ThisBuild / licenses := Seq("MIT" -> url("https://opensource.org/licenses/MIT"))
ThisBuild / scmInfo := Some(
ScmInfo(url("https://github.com/paulbutcher/ScalaMock"), "scm:git:[email protected]:paulbutcher/ScalaMock.git")
)
developers in ThisBuild := List(
ThisBuild / developers := List(
Developer("paulbutcher", "Paul Butcher", "", url("http://paulbutcher.com/")),
Developer("barkhorn", "Philipp Meyerhoefer", "", url("https://github.com/barkhorn"))
)
homepage in ThisBuild := Some(url("http://scalamock.org/"))
pomIncludeRepository in ThisBuild := { _ => false }
ThisBuild / homepage := Some(url("http://scalamock.org/"))
//ThisBuild / pomIncludeRepository := { _ => false }

version in ThisBuild := {
ThisBuild / version := {
val Snapshot = """(\d+)\.(\d+)\.(\d+)-\d+.*?""".r
git.gitDescribedVersion.value.getOrElse("0.0.0-1")match {
case Snapshot(maj, min, _) => s"$maj.${min.toInt + 1}.0-SNAPSHOT"
case v => v
}
}

isSnapshot in ThisBuild := version.value.endsWith("-SNAPSHOT")
ThisBuild / isSnapshot := version.value.endsWith("-SNAPSHOT")

publishTo in ThisBuild := Some(
ThisBuild / publishTo := Some(
if (isSnapshot.value) Opts.resolver.sonatypeSnapshots else Opts.resolver.sonatypeStaging
)
publishConfiguration in ThisBuild := publishConfiguration.value.withOverwrite(true)
publishLocalConfiguration in ThisBuild := publishLocalConfiguration.value.withOverwrite(true)
ThisBuild / publishConfiguration := publishConfiguration.value.withOverwrite(true)
ThisBuild / publishLocalConfiguration := publishLocalConfiguration.value.withOverwrite(true)

addCommandAlias("ci-all", ";+clean ;+compile ;+test ;+package")
addCommandAlias("release", ";+scalamockJVM/publishSigned ;+scalamockJS/publishSigned ;sonatypeReleaseAll")
Expand Down

0 comments on commit 443eacf

Please sign in to comment.