sbt-scapegoat
sbt-scapegoat copied to clipboard
Issues with enabling sbt-scapegoat plugin in a project that does not uses build.sbt
Hi everyone,
I have a project which does not have a build.sbt, instead there is a BuildSettings.scala file. I am trying to enable the scapegoat plugin in there and facing issues while doing so. Here is what I have done so far :
I added the addSbtPlugin("com.sksamuel.scapegoat" %% "sbt-scapegoat" % "1.0.4") to project/plugins.sbt file. Then tried building the project. it built successfully but when I try running scapegoat it gives following error
[error] Not a valid command: scapegoat (similar: set)
[error] Not a valid project ID: scapegoat
[error] Expected ':' (if selecting a configuration)
[error] Not a valid key: scapegoat (similar: aggregate)
[error] scapegoat
[error] ^
Then I tried adding the scapegoatVersion to BuildSettings.scala file and that gave me compile time error
project\BuildSettings.scala:29: not found: value scapegoatVersion
[error] scapegoatVersion := "1.0.4",
[error] ^
[error] one error found
[error] (compile:compile) Compilation failed
Then I added scapegoat as import to the BuildSettings.scala file, thinking that was missing. The error changes again
[error] bad symbolic reference. A signature in ScapegoatSbtPlugin.class refers to type AutoPlugin
[error] in package sbt which is not available.
[error] It may be completely missing from the current classpath, or the version on
[error] the classpath might be incompatible with the version used when compiling ScapegoatSbtPlugin.class.
[error] project\BuildSettings.scala:29: not found: value scapegoatVersion
[error] scapegoatVersion := "1.0.4",
[error] ^
[error] two errors found
[error] (compile:compile) Compilation failed
What might I be missing here. Please suggest some way/steps to enable this plugin properly for my project.
Thanks Nishant
@nshahcs You would need to import the following in your BuildSettings.scala before you can use the setting.
import com.sksamuel.scapegoat.sbt.ScapegoatSbtPlugin.autoImport._