1- import de .johoop .findbugs4sbt .ReportType
21import ReleaseTransformations ._
32
4- val buildSettings = findbugsSettings ++ jacoco.settings ++ osgiSettings ++ Seq [Setting [_]](
3+ val buildSettings = Seq [Setting [_]](
54 organization := " org.msgpack" ,
65 organizationName := " MessagePack" ,
76 organizationHomepage := Some (new URL (" http://msgpack.org/" )),
87 description := " MessagePack for Java" ,
9- scalaVersion := " 2.11.11 " ,
8+ scalaVersion := " 2.12.4 " ,
109 logBuffered in Test := false ,
10+ // msgpack-java should be a pure-java library, so remove Scala specific configurations
1111 autoScalaLibrary := false ,
1212 crossPaths := false ,
1313 // For performance testing, ensure each test run one-by-one
1414 concurrentRestrictions in Global := Seq (
1515 Tags .limit(Tags .Test , 1 )
1616 ),
1717 // JVM options for building
18- scalacOptions ++= Seq (" -encoding" , " UTF-8" , " -deprecation" , " -unchecked" , " -target:jvm-1.6 " , " -feature" ),
18+ scalacOptions ++= Seq (" -encoding" , " UTF-8" , " -deprecation" , " -unchecked" , " -target:jvm-1.7 " , " -feature" ),
1919 javaOptions in Test ++= Seq (" -ea" ),
20- javacOptions in (Compile , compile) ++= Seq (" -encoding" , " UTF-8" , " -Xlint:unchecked" , " -Xlint:deprecation" , " -source" , " 1.6 " , " -target" , " 1.6 " ),
20+ javacOptions in (Compile , compile) ++= Seq (" -encoding" , " UTF-8" , " -Xlint:unchecked" , " -Xlint:deprecation" , " -source" , " 1.7 " , " -target" , " 1.7 " ),
2121 // Use lenient validation mode when generating Javadoc (for Java8)
2222 javacOptions in doc := {
23- val opts = Seq (" -source" , " 1.6 " )
23+ val opts = Seq (" -source" , " 1.7 " )
2424 if (scala.util.Properties .isJavaAtLeast(" 1.8" )) {
2525 opts ++ Seq (" -Xdoclint:none" )
26- }
27- else {
26+ } else {
2827 opts
2928 }
3029 },
3130 // Release settings
3231 releaseTagName := { (version in ThisBuild ).value },
3332 releaseProcess := Seq [ReleaseStep ](
34- checkSnapshotDependencies,
35- inquireVersions,
36- runClean,
37- runTest,
38- setReleaseVersion,
39- commitReleaseVersion,
40- tagRelease,
41- ReleaseStep (action = Command .process(" publishSigned" , _)),
42- setNextVersion,
43- commitNextVersion,
44- ReleaseStep (action = Command .process(" sonatypeReleaseAll" , _)),
45- pushChanges
46- ),
47-
48- // Jacoco code coverage report
49- parallelExecution in jacoco.Config := false ,
50-
33+ checkSnapshotDependencies,
34+ inquireVersions,
35+ runClean,
36+ runTest,
37+ setReleaseVersion,
38+ commitReleaseVersion,
39+ tagRelease,
40+ releaseStepCommand(" publishSigned" ),
41+ setNextVersion,
42+ commitNextVersion,
43+ releaseStepCommand(" sonatypeReleaseAll" ),
44+ pushChanges
45+ ),
5146 // Find bugs
52- findbugsReportType := Some (ReportType .FancyHtml ),
47+ findbugsReportType := Some (FindbugsReport .FancyHtml ),
5348 findbugsReportPath := Some (crossTarget.value / " findbugs" / " report.html" ),
54-
5549 // Style check config: (sbt-jchekcstyle)
5650 jcheckStyleConfig := " facebook" ,
57-
5851 // Run jcheckstyle both for main and test codes
5952 (compile in Compile ) := ((compile in Compile ) dependsOn (jcheckStyle in Compile )).value,
6053 (compile in Test ) := ((compile in Test ) dependsOn (jcheckStyle in Test )).value
@@ -64,57 +57,61 @@ val junitInterface = "com.novocode" % "junit-interface" % "0.11" % "test"
6457
6558// Project settings
6659lazy val root = Project (id = " msgpack-java" , base = file(" ." ))
67- .settings(
68- buildSettings,
69- // Do not publish the root project
70- publishArtifact := false ,
71- publish := {},
72- publishLocal := {},
73- findbugs := {
74- // do not run findbugs for the root project
75- }
76- ).aggregate(msgpackCore, msgpackJackson)
60+ .settings(
61+ buildSettings,
62+ // Do not publish the root project
63+ publishArtifact := false ,
64+ publish := {},
65+ publishLocal := {},
66+ findbugs := {
67+ // do not run findbugs for the root project
68+ }
69+ )
70+ .aggregate(msgpackCore, msgpackJackson)
7771
7872lazy val msgpackCore = Project (id = " msgpack-core" , base = file(" msgpack-core" ))
79- .settings(
80- buildSettings,
81- description := " Core library of the MessagePack for Java" ,
82- OsgiKeys .bundleSymbolicName := " org.msgpack.msgpack-core" ,
83- OsgiKeys .exportPackage := Seq (
84- // TODO enumerate used packages automatically
85- " org.msgpack.core" ,
86- " org.msgpack.core.annotations" ,
87- " org.msgpack.core.buffer" ,
88- " org.msgpack.value" ,
89- " org.msgpack.value.impl"
90- ),
91- libraryDependencies ++= Seq (
92- // msgpack-core should have no external dependencies
93- junitInterface,
94- " org.scalatest" %% " scalatest" % " 3.0.3" % " test" ,
95- " org.scalacheck" %% " scalacheck" % " 1.13.5" % " test" ,
96- " org.xerial" %% " xerial-core" % " 3.6.0" % " test" ,
97- " org.msgpack" % " msgpack" % " 0.6.12" % " test" ,
98- " commons-codec" % " commons-codec" % " 1.10" % " test" ,
99- " com.typesafe.akka" %% " akka-actor" % " 2.3.16" % " test"
100- )
101- )
102-
103- lazy val msgpackJackson = Project (id = " msgpack-jackson" , base = file(" msgpack-jackson" ))
104- .settings(
105- buildSettings,
106- name := " jackson-dataformat-msgpack" ,
107- description := " Jackson extension that adds support for MessagePack" ,
108- OsgiKeys .bundleSymbolicName := " org.msgpack.msgpack-jackson" ,
109- OsgiKeys .exportPackage := Seq (
110- " org.msgpack.jackson" ,
111- " org.msgpack.jackson.dataformat"
112- ),
113- libraryDependencies ++= Seq (
114- " com.fasterxml.jackson.core" % " jackson-databind" % " 2.7.1" ,
115- junitInterface,
116- " org.apache.commons" % " commons-math3" % " 3.6.1" % " test"
117- ),
118- testOptions += Tests .Argument (TestFrameworks .JUnit , " -v" )
119- ).dependsOn(msgpackCore)
73+ .enablePlugins(SbtOsgi )
74+ .settings(
75+ buildSettings,
76+ description := " Core library of the MessagePack for Java" ,
77+ OsgiKeys .bundleSymbolicName := " org.msgpack.msgpack-core" ,
78+ OsgiKeys .exportPackage := Seq (
79+ // TODO enumerate used packages automatically
80+ " org.msgpack.core" ,
81+ " org.msgpack.core.annotations" ,
82+ " org.msgpack.core.buffer" ,
83+ " org.msgpack.value" ,
84+ " org.msgpack.value.impl"
85+ ),
86+ libraryDependencies ++= Seq (
87+ // msgpack-core should have no external dependencies
88+ junitInterface,
89+ " org.scalatest" %% " scalatest" % " 3.0.3" % " test" ,
90+ " org.scalacheck" %% " scalacheck" % " 1.13.5" % " test" ,
91+ " org.xerial" %% " xerial-core" % " 3.6.0" % " test" ,
92+ " org.msgpack" % " msgpack" % " 0.6.12" % " test" ,
93+ " commons-codec" % " commons-codec" % " 1.10" % " test" ,
94+ " com.typesafe.akka" %% " akka-actor" % " 2.5.7" % " test"
95+ )
96+ )
12097
98+ lazy val msgpackJackson =
99+ Project (id = " msgpack-jackson" , base = file(" msgpack-jackson" ))
100+ .enablePlugins(SbtOsgi )
101+ .settings(
102+ buildSettings,
103+ name := " jackson-dataformat-msgpack" ,
104+ description := " Jackson extension that adds support for MessagePack" ,
105+ OsgiKeys .bundleSymbolicName := " org.msgpack.msgpack-jackson" ,
106+ OsgiKeys .exportPackage := Seq (
107+ " org.msgpack.jackson" ,
108+ " org.msgpack.jackson.dataformat"
109+ ),
110+ libraryDependencies ++= Seq (
111+ " com.fasterxml.jackson.core" % " jackson-databind" % " 2.7.1" ,
112+ junitInterface,
113+ " org.apache.commons" % " commons-math3" % " 3.6.1" % " test"
114+ ),
115+ testOptions += Tests .Argument (TestFrameworks .JUnit , " -v" )
116+ )
117+ .dependsOn(msgpackCore)
0 commit comments