@@ -34,7 +34,7 @@ object ScapegoatSbtPlugin extends AutoPlugin {
34
34
35
35
import autoImport ._
36
36
37
- def doScapegoatClean (force : Boolean , classesDir : File , log : Logger ) {
37
+ def doScapegoatClean (force : Boolean , classesDir : File , log : Logger ): Unit = {
38
38
if (force) {
39
39
log.info(s " [scapegoat] Removing scapegoat class directory: $classesDir" )
40
40
IO .delete(Seq (classesDir))
@@ -64,12 +64,12 @@ object ScapegoatSbtPlugin extends AutoPlugin {
64
64
inConfig(Scapegoat ) {
65
65
Defaults .compileSettings ++
66
66
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,
70
70
scalacOptions := {
71
71
// 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)
73
73
// ensure we have the scapegoat dependency on the classpath and if so add it as a scalac plugin
74
74
scapegoatDependencies.find(_.getAbsolutePath.contains(ArtifactId )) match {
75
75
case None =>
@@ -104,7 +104,7 @@ object ScapegoatSbtPlugin extends AutoPlugin {
104
104
if (customMinimalWarnLevel.nonEmpty)
105
105
streamsValue.log.info(" [scapegoat] minimal warn level: " + customMinimalWarnLevel)
106
106
107
- (scalacOptions in Compile ).value ++ Seq (
107
+ (Compile / scalacOptions ).value ++ Seq (
108
108
Some (" -Xplugin:" + classpath.getAbsolutePath),
109
109
Some (" -P:scapegoat:verbose:" + scapegoatVerbose.value),
110
110
Some (" -P:scapegoat:consoleOutput:" + scapegoatConsoleOutput.value),
@@ -122,16 +122,16 @@ object ScapegoatSbtPlugin extends AutoPlugin {
122
122
},
123
123
)
124
124
} ++ 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,
127
127
scapegoatCleanTask := doScapegoatClean(
128
- (scapegoatRunAlways in ThisBuild ).value,
129
- (classDirectory in Scapegoat ).value,
128
+ (ThisBuild / scapegoatRunAlways ).value,
129
+ (Scapegoat / classDirectory ).value,
130
130
streams.value.log,
131
131
),
132
- scapegoatClean := doScapegoatClean(true , (classDirectory in Scapegoat ).value, streams.value.log),
132
+ scapegoatClean := doScapegoatClean(true , (Scapegoat / classDirectory ).value, streams.value.log),
133
133
// 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" ,
135
135
libraryDependencies += {
136
136
val selectedScapegoatVersion = (scapegoatVersion ? ).value.getOrElse {
137
137
scalaVersion.value match {
0 commit comments