0

I've a SBT project on a multi-project build set up.

  • root
  • sub-projectA (root depends on it)
  • sub-projectB (root depends on it)

I'd like to run scalastyle for only a few files within the project, which could be located in any of the three projects. In order to select those files, I'm modifying the scalastyleSources from the command line before running scalastyle like so:

sbt 'set scalastyleSources := Seq(file("app/util/Util.scala"))' scalastyle

This runs for root correctly upon the file that I'm specifying, but it then runs two more times for sub-projectA and sub-projectB, completely ignoring the files I previously assigned to the scalastyleSources.

I'd need a way to either let SBT know that I only want to run scalastyle once with the altered configuration OR the ability to ignore a certain project entirely when running the command.

Is this possible at all?

hasumedic
  • 2,139
  • 12
  • 17

1 Answers1

0

It's possible to disable the task in any of sub-projects with scalastyle := {}

Also, passing the file names as a command line parameter looks strange. In that case I would use scalastyle without sbt.

Konstantin Pelepelin
  • 1,303
  • 1
  • 14
  • 29