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

"compile" function in ScroogeSBT conflicts with sbt.Keys.compile #209

Closed
matthandlersux opened this issue Oct 15, 2015 · 3 comments
Closed

Comments

@matthandlersux
Copy link
Contributor

adding the scrooge sbt plugin causes sbt to import all of it's keys into the namespace of a built.sbt file. so in build.sbt, the top of the file magically receives:

import _root_.com.twitter.scrooge.ScroogeSBT._
import Keys._

this includes the compile function here: https://github.com/twitter/scrooge/blob/develop/scrooge-sbt-plugin/src/main/scala/com/twitter/ScroogeSBT.scala#L13 , but it collides with https://github.com/sbt/sbt/blob/1.0.x/main/src/main/scala/sbt/Keys.scala#L188

this becomes a problem when you want to have target specific settings, for example:

// in build.sbt
wartremoverErrors in (Compile, compile) ++= Seq(...)

// compile error:
//
// .../build.sbt:43: error: reference to compile is ambiguous;
// it is imported twice in the same scope by
// import _root_.com.twitter.scrooge.ScroogeSBT._
// and import Keys._
//  wartremoverErrors in (Compile, compile) ++= Seq(...)

as a temporary workaround, you can do:

// at the top of build.sbt
import Keys.{compile => sbtCompile}
...
wartremoverErrors in (Compile, sbtCompile) ++= Seq(...)

renaming the function in scrooge should fix it.

@matthandlersux matthandlersux changed the title compile function in ScroogeSBT conflicts with sbt.Keys.compile compile function in ScroogeSBT conflicts with sbt.Keys.compile Oct 15, 2015
@matthandlersux matthandlersux changed the title compile function in ScroogeSBT conflicts with sbt.Keys.compile "compile" function in ScroogeSBT conflicts with sbt.Keys.compile Oct 15, 2015
@mosesn
Copy link
Contributor

mosesn commented Oct 15, 2015

Sweet, you mind making a PR?

@matthandlersux
Copy link
Contributor Author

@mosesn yup, should have some time this weekend

@mosesn
Copy link
Contributor

mosesn commented May 29, 2016

This was fixed here: #210. Thanks @matthandlersux !

@mosesn mosesn closed this as completed May 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants