Skip to content

use (much!) newer MiMa (and sbt & Travis while we're at it) #13

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

Merged
merged 2 commits into from
Dec 1, 2016
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
target/
26 changes: 26 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# opt-in to Travis's newer/faster container-based infrastructure
sudo: false

language: scala

jdk:
- openjdk6

# cache stuff, hopefully shortening build times
cache:
directories:
- $HOME/.ivy2
- $HOME/.sbt/boot
- $HOME/.sbt/launchers

script:
- sbt test

before_cache:
- find $HOME/.sbt -name "*.lock" | xargs rm
- find $HOME/.ivy2 -name "ivydata-*.properties" | xargs rm

notifications:
email:
- [email protected]
- [email protected]
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ bintrayOrganization := None
// See code changes and docs: https://github.com/sbt/sbt-osgi/commit/e3625e685b8d1784938ec66067d629251811a9d1
addSbtPlugin("com.typesafe.sbt" % "sbt-osgi" % "0.7.0")

addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.1.8")
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.1.12")
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.9
sbt.version=0.13.13
10 changes: 5 additions & 5 deletions src/main/scala/ScalaModulePlugin.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import sbt._
import Keys._
import com.typesafe.sbt.osgi.{OsgiKeys, SbtOsgi}
import com.typesafe.tools.mima.plugin.{MimaPlugin, MimaKeys}
import com.typesafe.tools.mima.plugin.{MimaPlugin, MimaKeys}, MimaKeys._

object ScalaModulePlugin extends Plugin {
val repoName = settingKey[String]("The name of the repository under github.com/scala/.")
Expand Down Expand Up @@ -30,15 +30,15 @@ object ScalaModulePlugin extends Plugin {
scalacOptions in compile ++= Seq("-optimize", "-feature", "-deprecation", "-unchecked", "-Xlint"),

// Generate $name.properties to store our version as well as the scala version used to build
resourceGenerators in Compile <+= Def.task {
resourceGenerators in Compile += Def.task {
val props = new java.util.Properties
props.put("version.number", version.value)
props.put("scala.version.number", scalaVersion.value)
props.put("scala.binary.version.number", scalaBinaryVersion.value)
val file = (resourceManaged in Compile).value / s"${name.value}.properties"
IO.write(props, null, file)
Seq(file)
},
}.taskValue,

mappings in (Compile, packageBin) += {
(baseDirectory.value / s"${name.value}.properties") -> s"${name.value}.properties"
Expand Down Expand Up @@ -112,7 +112,7 @@ object ScalaModulePlugin extends Plugin {

lazy val mimaSettings: Seq[Setting[_]] = MimaPlugin.mimaDefaultSettings ++ Seq(
// manual cross-versioning because https://github.com/typesafehub/migration-manager/issues/62
MimaKeys.previousArtifact := Some(organization.value % s"${name.value}_${scalaBinaryVersion.value}" % mimaPreviousVersion.value.getOrElse("dummy")),
mimaPreviousArtifacts := Set(organization.value % s"${name.value}_${scalaBinaryVersion.value}" % mimaPreviousVersion.value.getOrElse("dummy")),

canRunMima := {
val mimaVer = mimaPreviousVersion.value
Expand All @@ -129,7 +129,7 @@ object ScalaModulePlugin extends Plugin {
},

runMimaIfEnabled := Def.taskDyn({
if(canRunMima.value) Def.task { MimaKeys.reportBinaryIssues.value }
if(canRunMima.value) Def.task { mimaReportBinaryIssues.value }
else Def.task { () }
}).value,

Expand Down