Skip to content

Commit 0766a8c

Browse files
authored
Migrate to slash syntax and convert to function syntax (#201)
* Migrate to slash syntax * Convert to function syntax
1 parent 611ea09 commit 0766a8c

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/main/scala/com/sksamuel/scapegoat/sbt/ScapegoatSbtPlugin.scala

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ object ScapegoatSbtPlugin extends AutoPlugin {
3434

3535
import autoImport._
3636

37-
def doScapegoatClean(force: Boolean, classesDir: File, log: Logger) {
37+
def doScapegoatClean(force: Boolean, classesDir: File, log: Logger): Unit = {
3838
if (force) {
3939
log.info(s"[scapegoat] Removing scapegoat class directory: $classesDir")
4040
IO.delete(Seq(classesDir))
@@ -64,12 +64,12 @@ object ScapegoatSbtPlugin extends AutoPlugin {
6464
inConfig(Scapegoat) {
6565
Defaults.compileSettings ++
6666
Seq(
67-
sources := (sources in Compile).value,
68-
managedClasspath := (managedClasspath in Compile).value,
69-
unmanagedClasspath := (unmanagedClasspath in Compile).value,
67+
sources := (Compile / sources).value,
68+
managedClasspath := (Compile / managedClasspath).value,
69+
unmanagedClasspath := (Compile / unmanagedClasspath).value,
7070
scalacOptions := {
7171
// find all deps for the compile scope
72-
val scapegoatDependencies = (update in Scapegoat).value matching configurationFilter(Scapegoat.name)
72+
val scapegoatDependencies = (Scapegoat / update).value matching configurationFilter(Scapegoat.name)
7373
// ensure we have the scapegoat dependency on the classpath and if so add it as a scalac plugin
7474
scapegoatDependencies.find(_.getAbsolutePath.contains(ArtifactId)) match {
7575
case None =>
@@ -104,7 +104,7 @@ object ScapegoatSbtPlugin extends AutoPlugin {
104104
if (customMinimalWarnLevel.nonEmpty)
105105
streamsValue.log.info("[scapegoat] minimal warn level: " + customMinimalWarnLevel)
106106

107-
(scalacOptions in Compile).value ++ Seq(
107+
(Compile / scalacOptions).value ++ Seq(
108108
Some("-Xplugin:" + classpath.getAbsolutePath),
109109
Some("-P:scapegoat:verbose:" + scapegoatVerbose.value),
110110
Some("-P:scapegoat:consoleOutput:" + scapegoatConsoleOutput.value),
@@ -122,16 +122,16 @@ object ScapegoatSbtPlugin extends AutoPlugin {
122122
},
123123
)
124124
} ++ Seq(
125-
(compile in Scapegoat) := ((compile in Scapegoat) dependsOn scapegoatClean).value,
126-
scapegoat := (compile in Scapegoat).value,
125+
(Scapegoat / compile) := ((Scapegoat / compile) dependsOn scapegoatClean).value,
126+
scapegoat := (Scapegoat / compile).value,
127127
scapegoatCleanTask := doScapegoatClean(
128-
(scapegoatRunAlways in ThisBuild).value,
129-
(classDirectory in Scapegoat).value,
128+
(ThisBuild / scapegoatRunAlways).value,
129+
(Scapegoat / classDirectory).value,
130130
streams.value.log,
131131
),
132-
scapegoatClean := doScapegoatClean(true, (classDirectory in Scapegoat).value, streams.value.log),
132+
scapegoatClean := doScapegoatClean(true, (Scapegoat / classDirectory).value, streams.value.log),
133133
// FIXME Cannot seem to make this a build setting (compile:crossTarget is an undefined setting)
134-
scapegoatOutputPath := (crossTarget in Compile).value.getAbsolutePath + "/scapegoat-report",
134+
scapegoatOutputPath := (Compile / crossTarget).value.getAbsolutePath + "/scapegoat-report",
135135
libraryDependencies += {
136136
val selectedScapegoatVersion = (scapegoatVersion ?).value.getOrElse {
137137
scalaVersion.value match {

0 commit comments

Comments
 (0)