What's the difference between :, :: and / in SBT?

℡╲_俬逩灬. 提交于 2021-01-28 00:18:56

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!