Skip to content

Commit

Permalink
More changes for sbt 0.13, also refactoring build according to effect…
Browse files Browse the repository at this point in the history
…ive sbt rules
  • Loading branch information
Heiko Seeberger committed Jul 8, 2013
1 parent 227caca commit b6a0a6d
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 13 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ Plugin for [sbt](http://www.scala-sbt.org) to to create [OSGi](http://www.osgi.o
Installing sbt-osgi
-------------------

sbt-osgi is a plugin for sbt. In order to install sbt, please refer to the [sbt documentation](http://www.scala-sbt.org/release/docs/Getting-Started/Setup.html). Please make sure that you are using a suitable version of sbt:
sbt-osgi is a plugin for sbt. In order to install sbt, please refer to the [sbt documentation](http://www.scala-sbt.org/release/docs/Getting-Started/Setup.html). Please make sure that you are using a suitable version of sbt:

- sbt-osgi 0.5 → sbt 0.12
- sbt-osgi 0.6 → sbt 0.13

As sbt-osgi is a plugin for sbt, it is installed like any other sbt plugin, that is by mere configuration: just add sbt-osgi to your global or local plugin definition. Global plugins are defined in `~/.sbt/<SBT_VERSION>/plugins/plugins.sbt` and local plugins are defined in `project/plugins.sbt` in your project.
As sbt-osgi is a plugin for sbt, it is installed like any other sbt plugin, that is by mere configuration: just add sbt-osgi to your global or local plugin definition. Global plugins are defined in `~/.sbt/<SBT_VERSION>/plugins/plugins.sbt` and local plugins are defined in `project/plugins.sbt` in your project.

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:

Expand Down
11 changes: 3 additions & 8 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@

organization := "com.typesafe.sbt"

name := "sbt-osgi"

// TODO Move version to version.sbt in order to support sbt-release
version := "0.6.0-SNAPSHOT"

libraryDependencies ++= Dependencies.sbtOsgi

scalacOptions ++= Seq(
"-unchecked",
"-deprecation",
Expand All @@ -15,14 +15,9 @@ scalacOptions ++= Seq(
"-encoding", "UTF-8"
)

libraryDependencies ++= Seq(
"biz.aQute.bnd" % "bndlib" % "2.1.0",
"org.specs2" %% "specs2" % "1.14" % "test"
)

sbtPlugin := true

publishTo := {
publishTo := {
import Classpaths._
val repo = if (isSnapshot.value) sbtPluginSnapshots else sbtPluginReleases
Some(repo)
Expand Down
22 changes: 22 additions & 0 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import sbt._

object Library {

// Versions
val bndVersion = "2.1.0"
val specs2Version = "1.14"

// Libraries
val bndLib = "biz.aQute.bnd" % "bndlib" % bndVersion
val specs2 = "org.specs2" %% "specs2" % specs2Version
}

object Dependencies {

import Library._

val sbtOsgi = List(
bndLib,
specs2 % "test"
)
}
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=0.13.0-Beta2
sbt.version=0.13.0-RC1
1 change: 0 additions & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

addSbtPlugin("com.typesafe.sbt" % "sbt-scalariform" % "1.1.0")

libraryDependencies += ("org.scala-sbt" % "scripted-plugin" % sbtVersion.value)
2 changes: 1 addition & 1 deletion scalariform.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ import scalariform.formatter.preferences.AlignSingleLineCaseStatements

scalariformSettings

ScalariformKeys.preferences <<= ScalariformKeys.preferences(_.setPreference(AlignSingleLineCaseStatements, true))
ScalariformKeys.preferences := ScalariformKeys.preferences.value.setPreference(AlignSingleLineCaseStatements, true)

0 comments on commit b6a0a6d

Please sign in to comment.