2

I have configured one SBT multi-module project with scoverage plugin, which is working fine.

To generate test coverage, I am using > SBT clean coverage test coverageReport but is there any way to create a new task which chains internally coverage test coverageReport.

I have tried Run custom task automatically before/after standard task to create a custom task, but it seems not working with multimodule project.

And one more - http://eed3si9n.com/sequencing-tasks-with-sbt-sequential

Kaushal
  • 3,237
  • 3
  • 29
  • 48

1 Answers1

1

Try addCommandAlias like so

addCommandAlias("coverageAll", ";clean;coverage;test;coverageReport")

Now executing sbt coverageAll should generate coverage report for all the sub-projects.

Mario Galic
  • 47,285
  • 6
  • 56
  • 98
  • Thanks, It works fine. But can I use existing task name for alias, something like ```addCommandAlias("test", ";clean;coverage;test;coverageReport")```. When I tried this, It goes in a recursive loop. – Kaushal Mar 17 '20 at 05:21