3

I was trying to recall whether it was test:compile, test::compile or test/compile that I wanted while doing something on SBT, when it struck me that though I have some intuition on which separator to use for what, I don't have a clear notion of what each separator is used for.

So, when typing tasks on the sbt console, when/for what do I use :, :: and /?

Daniel C. Sobral
  • 295,120
  • 86
  • 501
  • 681

1 Answers1

4

Different separators were used for different scope axis:

  • single colon : follows a configuration axis
  • double colon :: follows a task axis
  • slash / follows a subproject axis

However these have been unified by slash syntax: Unification of sbt shell notation and build.sbt DSL discussion led to Unify sbt shell and build.sbt syntax (scope path syntax) #3434 which released in 1.1.0 slash syntax

<project-id>/<config-ident>/intask/key

corresponding to

<project-id>/config:intask::key

hence, for example,

show root/Compile/compile/scalacOptions

corresponds to

show root/compile:compile::scalacOptions

Related question: what does a single colon mean in sbt

Eugene Yokota
  • 94,654
  • 45
  • 215
  • 319
Mario Galic
  • 47,285
  • 6
  • 56
  • 98