Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

scala

sbt

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?

like image 936
Hadil Sabbagh Avatar asked Oct 20 '22 12:10

Hadil Sabbagh


1 Answers

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.

like image 70
Dale Wijnand Avatar answered Nov 15 '22 07:11

Dale Wijnand