scalasbtscoverage

How to chain SBT task with multi module project


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


Solution

  • Try addCommandAlias like so

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

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