@@ -53,7 +53,7 @@ object ScalaModulePlugin extends AutoPlugin {
53
53
)
54
54
55
55
/**
56
- * Enable `-opt:l:inline`, `-opt:l:classpath ` or `-optimize`, depending on the scala version.
56
+ * Enable `-opt:l:inline`, `-opt:l:project ` or `-optimize`, depending on the scala version.
57
57
*/
58
58
lazy val enableOptimizer : Setting [_] = scalacOptions in (Compile , compile) ++= {
59
59
val Ver = """ (\d+)\.(\d+)\.(\d+).*""" .r
@@ -138,8 +138,26 @@ object ScalaModulePlugin extends AutoPlugin {
138
138
)
139
139
) ++ mimaSettings
140
140
141
+ @ deprecated(" use scalaModuleOsgiSettings instead" , " 2.2.0" )
141
142
lazy val scalaModuleSettingsJVM : Seq [Setting [_]] = scalaModuleOsgiSettings
142
143
144
+ // enables the SbtOsgi plugin and defines some default settings
145
+ lazy val scalaModuleOsgiSettings : Seq [Setting [_]] = SbtOsgi .projectSettings ++ SbtOsgi .autoImport.osgiSettings ++ Seq (
146
+ OsgiKeys .bundleSymbolicName := s " ${organization.value}. ${name.value}" ,
147
+ OsgiKeys .bundleVersion := osgiVersion.value,
148
+
149
+ // Sources should also have a nice MANIFEST file
150
+ packageOptions in packageSrc := Seq (Package .ManifestAttributes (
151
+ (" Bundle-SymbolicName" , s " ${organization.value}. ${name.value}.source " ),
152
+ (" Bundle-Name" , s " ${name.value} sources " ),
153
+ (" Bundle-Version" , osgiVersion.value),
154
+ (" Eclipse-SourceBundle" , s """ ${organization.value}. ${name.value};version=" ${osgiVersion.value}";roots:="." """ )
155
+ ))
156
+ )
157
+
158
+ // a setting-transform to turn the regular version into something osgi can deal with
159
+ private val osgiVersion = version(_.replace('-' , '.' ))
160
+
143
161
// adapted from https://github.com/lightbend/migration-manager/blob/0.3.0/sbtplugin/src/main/scala/com/typesafe/tools/mima/plugin/SbtMima.scala#L112
144
162
private def artifactExists (organization : String , name : String , scalaBinaryVersion : String , version : String , ivy : IvySbt , s : TaskStreams ): Boolean = {
145
163
val moduleId = ModuleID (organization, s " ${name}_ $scalaBinaryVersion" , version)
@@ -154,7 +172,7 @@ object ScalaModulePlugin extends AutoPlugin {
154
172
private val canRunMima = taskKey[Boolean ](" Decides if MiMa should run." )
155
173
private val runMimaIfEnabled = taskKey[Unit ](" Run MiMa if mimaPreviousVersion and the module can be resolved against the current scalaBinaryVersion." )
156
174
157
- private lazy val mimaSettings : Seq [Setting [_]] = MimaPlugin .mimaDefaultSettings ++ Seq (
175
+ private lazy val mimaSettings : Seq [Setting [_]] = Seq (
158
176
scalaModuleMimaPreviousVersion := None ,
159
177
160
178
// We're not using `%%` here in order to support both jvm and js projects (cross version `_2.12` / `_sjs0.6_2.12`)
@@ -184,22 +202,6 @@ object ScalaModulePlugin extends AutoPlugin {
184
202
(test in Test ).value
185
203
}
186
204
)
187
-
188
- // a setting-transform to turn the regular version into something osgi can deal with
189
- private val osgiVersion = version(_.replace('-' , '.' ))
190
-
191
- private lazy val scalaModuleOsgiSettings = SbtOsgi .projectSettings ++ SbtOsgi .autoImport.osgiSettings ++ Seq (
192
- OsgiKeys .bundleSymbolicName := s " ${organization.value}. ${name.value}" ,
193
- OsgiKeys .bundleVersion := osgiVersion.value,
194
-
195
- // Sources should also have a nice MANIFEST file
196
- packageOptions in packageSrc := Seq (Package .ManifestAttributes (
197
- (" Bundle-SymbolicName" , s " ${organization.value}. ${name.value}.source " ),
198
- (" Bundle-Name" , s " ${name.value} sources " ),
199
- (" Bundle-Version" , osgiVersion.value),
200
- (" Eclipse-SourceBundle" , s """ ${organization.value}. ${name.value};version=" ${osgiVersion.value}";roots:="." """ )
201
- ))
202
- )
203
205
}
204
206
205
207
0 commit comments