Difference from `{.}/*:name` and `*/*:name` in sbt?

谁都会走 提交于 2020-01-23 06:24:13

问题


From some sbt document(e.g. scopes), I see:

{.}/*:name

means name in entire build(use name in ThisBuild to define it)

*/*:name

means name in global project(use name in Global to define it)

(PS: I ignored the config part *:)

But, I still don't know what is the difference between them, they seem exactly the same to me.

Is there any thing I can do with one rather than another one?


回答1:


Whatever version you specified in ThisBuild will be applied to all projects in your build, overriding anything that was possibly defined in Global.

For example: Key "version"

For Global scope it was defined in Defaults.scala with value "0.1-SNAPSHOT".

For your projects in this build you might want to overwrite that with:

version in ThisBuild := "3.0.1"

So, because [{.}/*:version] has precedence over [*/*:version], whenever you get "version" in your projects, you fetch "3.0.1" instead of "0.1-SNAPSHOT".

This pretty much explains the difference and how you could use one and not the other.



来源:https://stackoverflow.com/questions/25841527/difference-from-name-and-name-in-sbt

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