SBT 中的 :、:: 和/之间有什么区别? [英] What's the difference between :, :: and / in SBT?

查看:86
本文介绍了SBT 中的 :、:: 和/之间有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图回忆在做某事时我想要的是 test:compiletest::compile 还是 test/compile在 SBT 上,虽然我对使用哪个分隔符有一些直觉,但我对每个分隔符的用途没有明确的概念.

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.

那么,当在 sbt 控制台上输入任务时,我何时/为了什么使用 :::/?

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

推荐答案

不同的分隔符用于不同的范围轴:

  • 单冒号 : 跟随一个配置轴
  • 双冒号 :: 跟随任务轴
  • 斜线 / 跟随子项目轴
  • single colon : follows a configuration axis
  • double colon :: follows a task axis
  • slash / follows a subproject axis

然而,这些已通过斜杠语法统一:统一 sbt shell 符号和 build.sbt DSL 讨论导致 统一 sbt shell 和 build.sbt 语法(范围路径语法)#3434 发布于 1.1.0 斜线语法

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

对应

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

因此,例如

show root/Compile/compile/scalacOptions

对应

show root/compile:compile::scalacOptions

相关问题:sbt 中的单个冒号是什么意思

这篇关于SBT 中的 :、:: 和/之间有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆