问题
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 /
?
回答1:
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
来源:https://stackoverflow.com/questions/59868243/whats-the-difference-between-and-in-sbt