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

Idiomatic way to run scapegoat on compile #54

Open
jjst opened this issue Sep 21, 2017 · 1 comment
Open

Idiomatic way to run scapegoat on compile #54

jjst opened this issue Sep 21, 2017 · 1 comment

Comments

@jjst
Copy link

jjst commented Sep 21, 2017

What's the idiomatic way to run scapegoat automatically on compile? ie. I want sbt compile to run scapegoat.

I tried adding this in my build.sbt:

compile in Compile := (compile in Compile).dependsOn(scapegoat).value

This works, however, it compiles all classes twice - once in target/scala-2.11/scapegoat-classes and once in target/scala-2.11/classes. Is there a better way?

@morgen-peschke
Copy link

This is back-of-the-napkin converted from something similar we're using for another liner:

(compile in Compile) := Def.taskDyn {
  val c = (compile in Compile).value
  Def.task {
    (scapegoat in Compile).toTask("").value
    c
  }
}.value

(compile in Test) := Def.taskDyn {
  val c = (compile in Test).value
  Def.task {
    (scapegoat in Test).toTask("").value
    c
  }
}.value

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