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

[2.8.x]: Fix release process (bp #352) #356

Merged
merged 2 commits into from
Nov 28, 2019
Merged
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
56 changes: 15 additions & 41 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@
*/
import sbt._
import sbt.util._
import scala.sys.process._
import sbt.io.Path._

import interplay.ScalaVersions
import ReleaseTransformations._

import com.typesafe.tools.mima.core._
import com.typesafe.tools.mima.plugin.MimaPlugin.mimaDefaultSettings
import com.typesafe.tools.mima.plugin.MimaKeys.mimaBinaryIssueFilters
import com.typesafe.tools.mima.plugin.MimaKeys.mimaPreviousArtifacts

import sbtcrossproject.crossProject
import sbtcrossproject.CrossPlugin.autoImport.crossProject
import sbtcrossproject.CrossType

resolvers ++= DefaultOptions.resolvers(snapshot = true)

playBuildRepoName in ThisBuild := "play-json"
publishTo in ThisBuild := sonatypePublishToBundle.value

val specsBuild = Def.setting[Seq[ModuleID]] {
val specsVersion = CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, 10)) => "3.9.1"
Expand Down Expand Up @@ -104,12 +104,6 @@ lazy val commonSettings = Def.settings(
// Filtering tests that are not stable in Scala 2.13 yet.
Tests.Argument(TestFrameworks.ScalaTest, "-l", "play.api.libs.json.UnstableInScala213")
),
publishTo := Some(
if (isSnapshot.value)
Opts.resolver.sonatypeSnapshots
else
Opts.resolver.sonatypeStaging
),
headerLicense := {
val currentYear = java.time.Year.now(java.time.Clock.systemUTC).getValue
Some(
Expand Down Expand Up @@ -140,10 +134,7 @@ lazy val root = project
`play-functionalJVM`,
`play-json-joda`
)
.settings(
commonSettings,
publishTo := None
)
.settings(commonSettings)

lazy val `play-json` = crossProject(JVMPlatform, JSPlatform)
.crossType(CrossType.Full)
Expand Down Expand Up @@ -228,15 +219,7 @@ lazy val `play-json` = crossProject(JVMPlatform, JSPlatform)
)
.dependsOn(`play-functional`)

lazy val `play-json-joda` = project
.in(file("play-json-joda"))
.enablePlugins(PlayLibrary)
.settings(
commonSettings ++ playJsonMimaSettings ++ Seq(
libraryDependencies ++= joda ++ specsBuild.value.map(_ % Test)
)
)
.dependsOn(`play-jsonJVM`)
lazy val `play-jsonJS` = `play-json`.js

lazy val `play-jsonJVM` = `play-json`.jvm.settings(
libraryDependencies ++=
Expand All @@ -247,7 +230,15 @@ lazy val `play-jsonJVM` = `play-json`.jvm.settings(
unmanagedSourceDirectories in Test ++= (baseDirectory.value.getParentFile.getParentFile / "docs/manual/working/scalaGuide" ** "code").get
)

lazy val `play-jsonJS` = `play-json`.js
lazy val `play-json-joda` = project
.in(file("play-json-joda"))
.enablePlugins(PlayLibrary)
.settings(
commonSettings ++ playJsonMimaSettings ++ Seq(
libraryDependencies ++= joda ++ specsBuild.value.map(_ % Test)
)
)
.dependsOn(`play-jsonJVM`)

lazy val `play-functional` = crossProject(JVMPlatform, JSPlatform)
.crossType(CrossType.Pure)
Expand Down Expand Up @@ -291,21 +282,4 @@ lazy val docs = project
.settings(commonSettings)
.dependsOn(`play-jsonJVM`)

playBuildRepoName in ThisBuild := "play-json"

releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
runTest,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
releaseStepCommandAndRemaining("+publishSigned"),
setNextVersion,
commitNextVersion,
releaseStepCommand("+sonatypeReleaseAll"),
pushChanges
)

addCommandAlias("validateCode", ";headerCheck;test:headerCheck;+scalafmtCheckAll;scalafmtSbtCheck")