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

new better release settings #2732

Merged
merged 4 commits into from
Feb 27, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
22 changes: 10 additions & 12 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ import sbtcrossproject.CrossProject
import sbtcrossproject.CrossPlugin.autoImport.{crossProject, CrossType}

lazy val scoverageSettings = Seq(
coverageEnabled := {
if (priorTo2_13(scalaVersion.value))
coverageEnabled.value
else
false
},
coverageMinimum := 60,
coverageFailOnMinimum := false,
coverageHighlighting := true
Expand All @@ -26,12 +32,6 @@ lazy val commonSettings = Seq(
case _ => Nil
}
},
coverageEnabled := {
if (priorTo2_13(scalaVersion.value))
coverageEnabled.value
else
false
},
resolvers ++= Seq(Resolver.sonatypeRepo("releases"), Resolver.sonatypeRepo("snapshots")),
parallelExecution in Test := false,
scalacOptions in (Compile, doc) := (scalacOptions in (Compile, doc)).value.filter(_ != "-Xfatal-warnings"),
Expand Down Expand Up @@ -389,8 +389,8 @@ lazy val docs = project

lazy val cats = project
.in(file("."))
.settings(moduleName := "root")
.settings(catsSettings)
.settings(moduleName := "root", crossScalaVersions := Nil)
.settings(publishSettings)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks a little weird to have publishSettings followed by noPublishSettings. This is intentional, right? If so, it might be helpful to have a brief comment about why this is being done.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. I added some comment here. The basic thing is that sbt release command is run through aggregation from this root module. Thus it requires some release settings, then the noPublishSettings makes sure the module itself is not published.

.settings(noPublishSettings)
.aggregate(catsJVM, catsJS)
.dependsOn(catsJVM, catsJS, tests.jvm % "test-internal -> test")
Expand Down Expand Up @@ -806,7 +806,6 @@ def priorTo2_13(scalaVersion: String): Boolean =
lazy val sharedPublishSettings = Seq(
releaseCrossBuild := true,
releaseTagName := tagName.value,
releasePublishArtifactsAction := PgpKeys.publishSigned.value,
releaseVcsSign := true,
useGpg := true, // bouncycastle has bugs with subkeys, so we use gpg instead
publishMavenStyle := true,
Expand All @@ -825,12 +824,11 @@ lazy val sharedReleaseProcess = Seq(
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
releaseStepCommand("validate"),
releaseStepCommandAndRemaining("+validate"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a switch from running validate from the current version to all versions? If so, does this lead to OOMs or anything?

Copy link
Contributor Author

@kailuowang kailuowang Feb 16, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really. Before the validate is still run against all scala versions because the crossScalaVersions settings on the root module and the releaseCrossBuild := true. sbt release automatically runs certain steps on each modules against all crossScalaVersions set on the root module. Now, with the new sbt version , the +validate will performe on each aggregated module correctly on their own crossScalaVersions. The root module's crossScalaVersions should set as Nil, otherwise it will conflict with the aggregrated module's crossScalaVersion.

setReleaseVersion,
commitReleaseVersion,
tagRelease,
publishArtifacts,
releaseStepCommandAndRemaining("+publishSigned"),
setNextVersion,
commitNextVersion,
releaseStepCommand("sonatypeReleaseAll"),
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.2.7
sbt.version=1.2.8