mirror of https://github.com/sbt/sbt.git
Add new user story representing the new RootPlugin feature. Update ordering/AddSettingsusage.
parent
8bde1c61ac
commit
1173f87415
|
|
@ -92,13 +92,8 @@ User adds the following to their `build.sbt`:
|
|||
```scala
|
||||
import AddSettings._
|
||||
|
||||
val autoPluginsExceptXYZ =
|
||||
plugins {
|
||||
case x: AutoPlugin => x != XYZ
|
||||
case _ => fasle
|
||||
}
|
||||
|
||||
val enableXYZ = plugins(_ == XYZ)
|
||||
val autoPluginsExceptXYZ = autoPlugins(_ != XYZ)
|
||||
val enableXYZ = autoPlugins(_ == XYZ)
|
||||
|
||||
val important = project.autoSettings(autoPluginsExceptXYZ, enableXYZ, projectSettings, defaultSbtFiles, userSettings)
|
||||
```
|
||||
|
|
@ -109,4 +104,22 @@ This would ensure the following setting order:
|
|||
2. The XYZ plugin specficially
|
||||
3. The settings configured via Build.scala files directly on project instances
|
||||
4. Any .sbt files found in the baseDirectory of the build.
|
||||
5. Any settings found in .sbt files of the User's sbt home (`~/.sbt/0.13`)
|
||||
5. Any settings found in .sbt files of the User's sbt home (`~/.sbt/0.13`)
|
||||
|
||||
## User Story: user wants to create a C++ workflow that does not include the Java workflow
|
||||
|
||||
1. User creates a 'root' plugin representing the core C++ features:
|
||||
|
||||
```scala
|
||||
object CppPlugin extends RootPlugin {
|
||||
override def projectSettings = ...
|
||||
override def globalSettings = ...
|
||||
}
|
||||
```
|
||||
|
||||
2. Create a helper project instantiation.
|
||||
|
||||
```scala
|
||||
def cppProject(name: String, dir: File): Project =
|
||||
Project(name,file).disablePlugin(plugins.JvmModule).addPlugins(CppPlugin)
|
||||
```
|
||||
Loading…
Reference in New Issue