Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

scope

global

sbt

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?

like image 289
Freewind Avatar asked Sep 15 '14 05:09

Freewind


1 Answers

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.

like image 157
Renat Bekbolatov Avatar answered Oct 12 '22 08:10

Renat Bekbolatov