1
1
import sbt ._
2
2
import Keys ._
3
3
import com .typesafe .sbt .osgi .{OsgiKeys , SbtOsgi }
4
- import com .typesafe .tools .mima .plugin .{MimaPlugin , MimaKeys }
4
+ import com .typesafe .tools .mima .plugin .{MimaPlugin , MimaKeys }, MimaKeys . _
5
5
6
6
object ScalaModulePlugin extends Plugin {
7
7
val repoName = settingKey[String ](" The name of the repository under github.com/scala/." )
@@ -30,15 +30,15 @@ object ScalaModulePlugin extends Plugin {
30
30
scalacOptions in compile ++= Seq (" -optimize" , " -feature" , " -deprecation" , " -unchecked" , " -Xlint" ),
31
31
32
32
// Generate $name.properties to store our version as well as the scala version used to build
33
- resourceGenerators in Compile < += Def .task {
33
+ resourceGenerators in Compile += Def .task {
34
34
val props = new java.util.Properties
35
35
props.put(" version.number" , version.value)
36
36
props.put(" scala.version.number" , scalaVersion.value)
37
37
props.put(" scala.binary.version.number" , scalaBinaryVersion.value)
38
38
val file = (resourceManaged in Compile ).value / s " ${name.value}.properties "
39
39
IO .write(props, null , file)
40
40
Seq (file)
41
- },
41
+ }.taskValue ,
42
42
43
43
mappings in (Compile , packageBin) += {
44
44
(baseDirectory.value / s " ${name.value}.properties " ) -> s " ${name.value}.properties "
@@ -112,7 +112,7 @@ object ScalaModulePlugin extends Plugin {
112
112
113
113
lazy val mimaSettings : Seq [Setting [_]] = MimaPlugin .mimaDefaultSettings ++ Seq (
114
114
// manual cross-versioning because https://github.com/typesafehub/migration-manager/issues/62
115
- MimaKeys .previousArtifact := Some (organization.value % s " ${name.value}_ ${scalaBinaryVersion.value}" % mimaPreviousVersion.value.getOrElse(" dummy" )),
115
+ mimaPreviousArtifacts := Set (organization.value % s " ${name.value}_ ${scalaBinaryVersion.value}" % mimaPreviousVersion.value.getOrElse(" dummy" )),
116
116
117
117
canRunMima := {
118
118
val mimaVer = mimaPreviousVersion.value
@@ -129,7 +129,7 @@ object ScalaModulePlugin extends Plugin {
129
129
},
130
130
131
131
runMimaIfEnabled := Def .taskDyn({
132
- if (canRunMima.value) Def .task { MimaKeys .reportBinaryIssues .value }
132
+ if (canRunMima.value) Def .task { mimaReportBinaryIssues .value }
133
133
else Def .task { () }
134
134
}).value,
135
135
0 commit comments