Skip to content

Commit ddbdcac

Browse files
authored
Merge pull request #101 from SethTisue/slash-syntax
code cleanup: use slash syntax instead of 'in'
2 parents ca87942 + 5aa7df0 commit ddbdcac

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/main/scala/ScalaModulePlugin.scala

+10-10
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ object ScalaModulePlugin extends AutoPlugin {
5555
/**
5656
* Enable `-opt:l:inline`, `-opt:l:project` or `-optimize`, depending on the scala version.
5757
*/
58-
lazy val enableOptimizer: Setting[_] = scalacOptions in (Compile, compile) ++= {
58+
lazy val enableOptimizer: Setting[_] = Compile / compile / scalacOptions ++= {
5959
val Ver = """(\d+)\.(\d+)\.(\d+).*""".r
6060
val Ver("2", maj, min) = scalaVersion.value
6161
(maj.toInt, min.toInt) match {
@@ -66,7 +66,7 @@ object ScalaModulePlugin extends AutoPlugin {
6666
}
6767

6868
lazy val disablePublishing: Seq[Setting[_]] = Seq(
69-
skip in publish := true // works in sbt 1+
69+
publish / skip := true
7070
)
7171

7272
/**
@@ -78,20 +78,20 @@ object ScalaModulePlugin extends AutoPlugin {
7878
organization := "org.scala-lang.modules",
7979

8080
// don't use for doc scope, scaladoc warnings are not to be reckoned with
81-
scalacOptions in (Compile, compile) ++= Seq("-feature", "-deprecation", "-unchecked", "-Xlint"),
81+
Compile / compile / scalacOptions ++= Seq("-feature", "-deprecation", "-unchecked", "-Xlint"),
8282

8383
// Generate $name.properties to store our version as well as the scala version used to build
84-
resourceGenerators in Compile += Def.task {
84+
Compile / resourceGenerators += Def.task {
8585
val props = new java.util.Properties
8686
props.put("version.number", version.value)
8787
props.put("scala.version.number", scalaVersion.value)
8888
props.put("scala.binary.version.number", scalaBinaryVersion.value)
89-
val file = (resourceManaged in Compile).value / s"${name.value}.properties"
89+
val file = (Compile / resourceManaged).value / s"${name.value}.properties"
9090
IO.write(props, null, file)
9191
Seq(file)
9292
}.taskValue,
9393

94-
mappings in (Compile, packageBin) += {
94+
Compile / packageBin / mappings += {
9595
(baseDirectory.value / s"${name.value}.properties") -> s"${name.value}.properties"
9696
},
9797

@@ -100,7 +100,7 @@ object ScalaModulePlugin extends AutoPlugin {
100100
// so that scalac see classes used to run it, as classes used to compile against...
101101
// forking uses a minimal classpath, so this craziness is avoided
102102
// alternatively, manage the scala instance as shown at the end of this file (commented)
103-
fork in Test := true,
103+
Test / fork := true,
104104

105105
headerLicense := Some(HeaderLicense.Custom(
106106
s"""|Scala (https://www.scala-lang.org)
@@ -147,7 +147,7 @@ object ScalaModulePlugin extends AutoPlugin {
147147
OsgiKeys.bundleVersion := osgiVersion.value,
148148

149149
// Sources should also have a nice MANIFEST file
150-
packageOptions in packageSrc := Seq(Package.ManifestAttributes(
150+
packageSrc / packageOptions := Seq(Package.ManifestAttributes(
151151
("Bundle-SymbolicName", s"${organization.value}.${name.value}.source"),
152152
("Bundle-Name", s"${name.value} sources"),
153153
("Bundle-Version", osgiVersion.value),
@@ -197,9 +197,9 @@ object ScalaModulePlugin extends AutoPlugin {
197197
else Def.task { () }
198198
}).value,
199199

200-
test in Test := {
200+
Test / test := {
201201
runMimaIfEnabled.value
202-
(test in Test).value
202+
(Test / test).value
203203
}
204204
)
205205
}

0 commit comments

Comments
 (0)