sbt-scapegoat icon indicating copy to clipboard operation
sbt-scapegoat copied to clipboard

Issues with enabling sbt-scapegoat plugin in a project that does not uses build.sbt

Open nshahcs opened this issue 8 years ago • 1 comments

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 avatar May 19 '16 06:05 nshahcs

@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._

smrutimo avatar Sep 15 '16 20:09 smrutimo