scct and webapp templates

49 views
Skip to first unread message

Tim Nelson

unread,
Jun 22, 2012, 12:04:23 PM6/22/12
to simple-b...@googlegroups.com
Hi,

We're using the scct plugin [1] for code coverage. We also have this line in our build file that gives our tests access to our webapp templates:

unmanagedClasspath in Test <+= (baseDirectory) map { bd => Attributed.blank(bd / "src/main/webapp") }

Our tests run fine when using 'test', but when we run 'coverage:test' our tests can't find the templates.

Does anyone know what we need to do to get our tests to see the templates when running coverage:test?

Thanks,
Tim

Doug Tangren

unread,
Jun 22, 2012, 12:07:10 PM6/22/12
to simple-b...@googlegroups.com
On Fri, Jun 22, 2012 at 12:04 PM, Tim Nelson <tnel...@gmail.com> wrote:
unmanagedClasspath in Test <+= (baseDirectory) map { bd => Attributed.blank(bd / "src/main/webapp") }

perhaps

unmanagedClasspath in (YourConfig, Test) <+= (baseDirectory) map { bd => Attributed.blank(bd / "src/main/webapp") }

Tim Nelson

unread,
Jun 22, 2012, 12:13:42 PM6/22/12
to simple-b...@googlegroups.com
I actually tried that, but sbt complains:

error: overloaded method value in with alternatives:
  (p: sbt.Reference,t: sbt.Scoped)sbt.TaskKey[sbt.Keys.Classpath] <and>
  (p: sbt.Reference,c: sbt.ConfigKey)sbt.TaskKey[sbt.Keys.Classpath] <and>
  (c: sbt.ConfigKey,t: sbt.Scoped)sbt.TaskKey[sbt.Keys.Classpath]
 cannot be applied to (sbt.Configuration, sbt.Configuration)
unmanagedClasspath in (Coverage, Test) <+= (baseDirectory) map { bd => Attributed.blank(bd / "src/main/webapp") }

We've also tried, just:

unmanagedClasspath in Coverage <+= (baseDirectory) map { bd => Attributed.blank(bd / "src/main/webapp") }

But, that doesn't work either.

There seems to be something about how the scct plugin is calling the tests that's causing the problem.

Tim

Tim Nelson

unread,
Jun 22, 2012, 3:51:24 PM6/22/12
to simple-b...@googlegroups.com
Hi,

I figured it out. sbt-scct overwrites fullClasspath. So, you need to append to that instead of unmanagedResources in the CoverageTest configuration.

fullClasspath in CoverageTest <+= (baseDirectory) map { bd => Attributed.blank(bd / "src/main/webapp") }

Tim
Reply all
Reply to author
Forward
0 new messages