sbt/sbt-osgi — pull request #18 by arashi01 (2014-08-23 01:39:39+00:00)
Title: Migrate from sbt.Plugin => sbt.AutoPlugin for automatic and safe injection of settings / plugin dependencies

We have been making heavy use of internal sbt-plugins for uniform configuration of builds, and migrating to sbt 0.13.5 have found the new Autoplugin [plugin dependencies][1] feature very useful for this purpose; allowing one to specify a requirement on a plugin as well as its requirements, and having all necessary settings provided to specific projects.

This change updates SbtOsgi to extend [sbt.AutoPlugin][2] instead of [sbt.Plugin][3] (similar to sbt-web, play etc.).

- `SbtOsgi.defaultOsgiSettings` are now provided automatically to all projects which explicitly enable `SbtOsgi` via the `enablePlugins(Plugins*)` method.

- `osgiSettings` and the `OsgiKeys` alias have been moved from `SbtOsgi` to `SbtOsgi.autoImport` as only members of an object named `autoImport` are automatically imported into scope in '*.sbt' files, unlike the behaviour of `sbt.Plugin`

- TaskKey and SettingKey ids have been updated to match the current convention of lowerCamelCase instead of hyphen-separated-lowercase.

- README updated to match usage changes.

Usage changes as follows:
Plugin is enabled, and `defaultOsgiSettings` appended to a project settings when `enablePlugins(SbtOsgi)` is called on the project; so appending `defaultOsgiSettings` to project settings is replaced by the call to `enablePlugins(SbtOsgi)`. eg. :

```scala
lazy val fooProject = (project in file("."))
.enablePlugins(SbtOsgi) // Enables sbt-osgi for this project. This will automatically append
// the plugin's default settings to this project thus providing the
// `osgiBundle` task.

osgiSettings // Override the default publish behaviour

```

[1]: http://www.scala-sbt.org/release/docs/Plugins.html#Plugin+dependencies
[2]: http://www.scala-sbt.org/0.13.5/api/#sbt.AutoPlugin
[3]: http://www.scala-sbt.org/0.13.5/api/#sbt.Plugin