Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to list all configurations with their description?

Tags:

sbt

I use sbt 0.13.5.

From the sbt console, how can one see a list of all the defined configurations in a project (e.g. Compile, Test, etc) and their description?

like image 757
shawnuser3862921 Avatar asked Jul 30 '14 19:07

shawnuser3862921


1 Answers

I don't know if there is a built-in command for that. Unless there is one, you could create a task doing just that:

build.sbt

lazy val showConfigurations = taskKey[Unit]("Shows all configurations")

lazy val inAnyProjectAndConfiguration = ScopeFilter(inAnyProject, inAnyConfiguration)

showConfigurations := {
  val configs = configuration.all(inAnyProjectAndConfiguration).value.toSet
  configs.filter(_.isPublic).foreach(c => println(s"${c.name} ${c.description}"))
}

You may not see descriptions for some configurations, because it's not mandatory. As a matter of fact, it seems that none of the default ones have it.

like image 88
lpiepiora Avatar answered Sep 29 '22 08:09

lpiepiora