Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
nshahcs opened this issue May 19, 2016 · 1 comment

Comments

@nshahcs
Copy link

nshahcs commented May 19, 2016

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

@smrutimo
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants