Skip to content

Commit

Permalink
Upgrade to sbt 1.0 and fix issues with MiMa versioning
Browse files Browse the repository at this point in the history
- Upgrade to sbt 1.0 to solve a weird bug with MiMa
  (lightbend-labs/mima#206)
- Add missing resolver
- Remove name supression config
- Fix resolver issue
  • Loading branch information
jeffmay committed Sep 28, 2018
1 parent 85f79ad commit d18a66f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 30 deletions.
39 changes: 13 additions & 26 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,42 +1,30 @@
import Dependencies._

name := "play-module-json-error-handler-root"
organizationName in ThisBuild := "Rally Health"
organization in ThisBuild := "com.rallyhealth"

scalaVersion in ThisBuild := Scala_2_11
ThisBuild / organizationName := "Rally Health"
ThisBuild / organization := "com.rallyhealth"

licenses in ThisBuild := Seq("MIT" -> url("http://opensource.org/licenses/MIT"))
ThisBuild / scalaVersion := Scala_2_11

bintrayOrganization in ThisBuild := Some("rallyhealth")
bintrayRepository in ThisBuild := "maven"
ThisBuild / licenses := Seq("MIT" -> url("http://opensource.org/licenses/MIT"))

resolvers in ThisBuild += Resolver.bintrayRepo("jeffmay", "maven")
ThisBuild / bintrayOrganization := Some("rallyhealth")
ThisBuild / bintrayRepository := "maven"

ThisBuild / resolvers += Resolver.bintrayRepo("rallyhealth", "maven")
ThisBuild / resolvers += Resolver.bintrayRepo("jeffmay", "maven")

// Disable publishing of root project
publish := {}
publishLocal := {}

/**
* Suppress naming check until next minor version.
*
* @note just delete this code if you get the following exception
*/
val suppressNameCheckUntilNextMajorVersion = semVerCheck := {
version.value.split('.') match {
case Array("0", minor, _*) if minor.toInt < 2 =>
case Array("0", "2", "0", _*) =>
case _ => // anything > 0.2.0
throw new IllegalStateException("Version bump! It's time to re-enable semantic version validation.")
}
}

def commonProject(id: String, path: String): Project = {
Project(id, file(path))
.settings(
// disable scaladoc generation
sources in(Compile, doc) := Seq.empty,
publishArtifact in packageDoc := false,
Compile / doc / sources := Seq.empty,
packageDoc / publishArtifact := false,

scalacOptions := scalacOptions.value
.filterNot(_ == "-deprecation") ++ Seq(
Expand All @@ -62,12 +50,11 @@ def playModuleJsonErrorHandler(includePlayVersion: String): Project = {
val projectPath = "code"
commonProject(s"play$playSuffix-module-json-error-handler", s"play$playSuffix")
.settings(
suppressNameCheckUntilNextMajorVersion,
scalaVersion := scalaVersions.head,
crossScalaVersions := scalaVersions,
sourceDirectory := file(s"$projectPath/src").getAbsoluteFile,
(sourceDirectory in Compile) := file(s"$projectPath/src/main").getAbsoluteFile,
(sourceDirectory in Test) := file(s"$projectPath/src/test").getAbsoluteFile,
Compile / sourceDirectory := file(s"$projectPath/src/main").getAbsoluteFile,
Test / sourceDirectory := file(s"$projectPath/src/test").getAbsoluteFile,
libraryDependencies ++= Seq(
Dependencies.guice,
Dependencies.play(includePlayVersion),
Expand Down
8 changes: 6 additions & 2 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ object Dependencies {
final val Scala_2_12 = "2.12.6"

final val Play_2_5 = "2.5.18"
final val Play_2_6 = "2.6.16"
final val Play_2_6 = "2.6.19"

private final val guiceVersion = "4.0"
private final val play25JsonVersion = Play_2_5
Expand Down Expand Up @@ -37,7 +37,11 @@ object Dependencies {
}

def playTestOps(playVersion: String): ModuleID = {
"me.jeffmay" %% "play25-test-ops-core" % playTestOpsVersion
val playSuffix = playVersion match {
case Play_2_5 => "25"
case Play_2_6 => "26"
}
"me.jeffmay" %% s"play$playSuffix-test-ops-core" % playTestOpsVersion
}

val scalatest: ModuleID = {
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=0.13.17
sbt.version=1.2.3
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ resolvers += Resolver.url(
url("https://dl.bintray.com/rallyhealth/sbt-plugins")
)(Resolver.ivyStylePatterns)

addSbtPlugin("com.rallyhealth.sbt" % "sbt-git-versioning" % "1.1.0")
addSbtPlugin("com.rallyhealth.sbt" %% "sbt-git-versioning" % "1.2.0")
addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.4")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.1")
addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.2.6")

0 comments on commit d18a66f

Please sign in to comment.