Skip to content

Commit 128738c

Browse files
author
Mathias Bogaert
committed
Unify more in single build.sbt file. Upgrade of SBT plugins.
1 parent 544607a commit 128738c

File tree

4 files changed

+65
-93
lines changed

4 files changed

+65
-93
lines changed

build.sbt

Lines changed: 59 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,69 @@
11
import com.typesafe.sbt.osgi.SbtOsgi._
2+
import com.typesafe.sbt.SbtScalariform
3+
import com.typesafe.sbt.SbtScalariform.ScalariformKeys
4+
import com.typesafe.sbt.osgi.SbtOsgi
25

3-
lazy val scalaLogging = project in file(".")
6+
import scalariform.formatter.preferences.{AlignSingleLineCaseStatements, DoubleIndentClassDeclaration}
47

5-
name := "scala-logging"
8+
enablePlugins(SbtOsgi)
69

7-
Common.settings ++ defaultOsgiSettings ++ Seq(
8-
packageBin in Runtime <<= OsgiKeys.bundle,
9-
packagedArtifact in (Compile, packageBin) <<= (artifact in (Compile, packageBin), OsgiKeys.bundle).identityMap,
10-
OsgiKeys.exportPackage := Seq("com.typesafe.scalalogging")
10+
name := "scala-logging"
11+
organization := "com.typesafe.scala-logging"
12+
licenses := Seq("Apache 2.0 License" -> url("http://www.apache.org/licenses/LICENSE-2.0.html"))
13+
homepage := Some(url("https://github.com/typesafehub/scala-logging"))
14+
scalaVersion := Version.scala
15+
crossScalaVersions := Version.crossScala
16+
scalacOptions ++= List(
17+
"-unchecked",
18+
"-deprecation",
19+
"-language:_",
20+
"-encoding", "UTF-8"
1121
)
1222

23+
osgiSettings
24+
25+
OsgiKeys.bundleSymbolicName := s"com.typesafe.scalalogging"
26+
OsgiKeys.exportPackage := Seq(s"com.typesafe.scalalogging.*;version=${version.value}")
27+
28+
packageBin in Runtime <<= OsgiKeys.bundle
29+
packagedArtifact in (Compile, packageBin) <<= (artifact in (Compile, packageBin), OsgiKeys.bundle).identityMap
30+
31+
unmanagedSourceDirectories in Compile := List((scalaSource in Compile).value)
32+
unmanagedSourceDirectories in Test := List((scalaSource in Test).value)
33+
34+
releaseVersionBump := sbtrelease.Version.Bump.Minor
35+
releaseCrossBuild := true
36+
releasePublishArtifactsAction := PgpKeys.publishSigned.value
37+
38+
SbtScalariform.scalariformSettings
39+
40+
ScalariformKeys.preferences := ScalariformKeys.preferences.value
41+
.setPreference(AlignSingleLineCaseStatements, true)
42+
.setPreference(AlignSingleLineCaseStatements.MaxArrowIndent, 100)
43+
.setPreference(DoubleIndentClassDeclaration, true)
44+
1345
libraryDependencies ++= Dependencies.scalaLogging(scalaVersion.value)
1446

1547
initialCommands := """|import com.typesafe.scalalogging._
1648
|import org.slf4j.{ Logger => Underlying, _ }""".stripMargin
49+
50+
publishTo <<= isSnapshot(isSnapshot => Some(if (isSnapshot) Opts.resolver.sonatypeSnapshots else Opts.resolver.sonatypeStaging))
51+
publishArtifact in Test := false
52+
pomIncludeRepository := (_ => false)
53+
pomExtra :=
54+
<scm>
55+
<url>https://github.com/typesafehub/scala-logging</url>
56+
<connection>scm:git:git://github.com/typesafehub/scala-logging.git</connection>
57+
</scm>
58+
<developers>
59+
<developer>
60+
<id>hseeberger</id>
61+
<name>Heiko Seeberger</name>
62+
<url>http://heikoseeberger.de</url>
63+
</developer>
64+
<developer>
65+
<id>analytically</id>
66+
<name>Mathias Bogaert</name>
67+
<url>http://twitter.com/analytically</url>
68+
</developer>
69+
</developers>

project/Common.scala

Lines changed: 0 additions & 82 deletions
This file was deleted.

project/Dependencies.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ object Library {
1818
}
1919

2020
object Dependencies {
21-
2221
import Library._
2322

2423
def scalaLogging(scalaVersion: String) = List(

project/plugins.sbt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
resolvers += Resolver.typesafeRepo("releases")
2+
13
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.0")
24

3-
addSbtPlugin("com.typesafe.sbt" % "sbt-scalariform" % "1.3.0")
5+
addSbtPlugin("org.scalariform" % "sbt-scalariform" % "1.6.0")
46

5-
addSbtPlugin("com.github.gseitz" % "sbt-release" % "0.8.5")
7+
addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.3")
68

7-
addSbtPlugin("com.typesafe.sbt" % "sbt-osgi" % "0.7.0")
9+
addSbtPlugin("com.typesafe.sbt" % "sbt-osgi" % "0.9.1")
810

9-
addSbtPlugin("com.scalapenos" % "sbt-prompt" % "0.2.1")
11+
addSbtPlugin("com.scalapenos" % "sbt-prompt" % "1.0.0")

0 commit comments

Comments
 (0)