Hadil Sabbagh
Hadil Sabbagh

Reputation: 61

sbt 0.13.8 -- what is the difference between buildSettings and projectSettings?

I am writing a new plugin for 0.13.8 and I can't seem to figure out the difference between the buildSettings Seq and the projectSettings Seq.

Can someone clarify?

Upvotes: 6

Views: 1066

Answers (1)

Dale Wijnand
Dale Wijnand

Reputation: 6102

From the docs:

With auto plugins, all provided settings (e.g. assemblySettings) are provided by the plugin directly via the projectSettings method.

And later on:

If the plugin needs to append settings at the build-level (that is, in ThisBuild) there’s a buildSettings method. The settings returned here are guaranteed to be added to a given build scope only once regardless of how many projects for that build activate this AutoPlugin.

The globalSettings is appended once to the global settings (in Global). These allow a plugin to automatically provide new functionality or new defaults. One main use of this feature is to globally add commands, such as for IDE plugins.

Use globalSettings to define the default value of a setting.

Upvotes: 4

Related Questions