Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix code tags in README.md #130

Merged
merged 1 commit into from
Jan 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 6 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ As sbt-osgi is a plugin for sbt, it is installed like any other sbt plugin, that

In order to add sbt-osgi as a plugin, just add the below setting to the relevant plugin definition, paying attention to blank lines between settings:

```
```sbt
// Other stuff

addSbtPlugin("com.github.sbt" % "sbt-osgi" % "0.9.11")
```

If you want to use the latest and greatest features, you can instead have sbt depend on and locally build the current source snapshot by adding the following to your plugin definition file.
Example `<PROJECT_ROOT>/project/plugins.sbt`:
```scala
```sbt
lazy val plugins = (project in file("."))
.dependsOn(sbtOsgi)

Expand All @@ -41,31 +41,15 @@ As, since version `0.8.0`, sbt-osgi uses the sbt 0.13.5 *Autoplugin* feature, it

Example `<PROJECT_ROOT>/build.sbt`:

```scala
```sbt
enablePlugins(SbtOsgi)
```

Example `<PROJECT_ROOT>/project/Build.scala`:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This way of defining an sbt build is no longer supported

```scala
import sbt._
import com.github.sbt.SbtOsgi.autoImport._ // The autoImport object contains everything which would normally be
// imported automatically in '*.sbt' project definition files.

object Build extends sbt.Build {

lazy val fooProject = Project("foo-project", 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.
}

```

To also override the default publish behaviour, also add the `osgiSettings` settings to your project via your preferred method.

Example `<PROJECT_ROOT>/build.sbt`:

```scala
```sbt
// Other settings

osgiSettings
Expand All @@ -74,7 +58,7 @@ osgiSettings
#### Version 0.7.0 and below
Add the below line to your sbt build definition, which adds the task `osgiBundle` which creates an OSGi bundle for your project and also changes the `publish` task to publish an OSGi bundle instead of a raw JAR archive. Again, pay attention to the blank line between settings:

```
```sbt
// Other stuff

osgiSettings
Expand Down Expand Up @@ -112,7 +96,7 @@ sbt-osgi can be configured with the following settings:

Example `build.sbt`:

```
```sbt
organization := "com.github.sbt"

name := "osgi.demo"
Expand Down
Loading