11import de .johoop .findbugs4sbt .ReportType
2+ import ReleaseTransformations ._
23
3- organization := " org.msgpack"
4- organizationName := " MessagePack"
5- organizationHomepage := Some (new URL (" http://msgpack.org/" ))
6- description := " MessagePack for Java"
7- scalaVersion in Global := " 2.11.7"
8- logBuffered in Test := false
9- autoScalaLibrary := false
10- crossPaths := false
11-
12- // For performance testing, ensure each test run one-by-one
13- concurrentRestrictions in Global := Seq (
14- Tags .limit(Tags .Test , 1 )
4+ val buildSettings = findbugsSettings ++ jacoco.settings ++ Seq [Setting [_]](
5+ organization := " org.msgpack" ,
6+ organizationName := " MessagePack" ,
7+ organizationHomepage := Some (new URL (" http://msgpack.org/" )),
8+ description := " MessagePack for Java" ,
9+ scalaVersion := " 2.11.7" ,
10+ logBuffered in Test := false ,
11+ autoScalaLibrary := false ,
12+ crossPaths := false ,
13+ // For performance testing, ensure each test run one-by-one
14+ concurrentRestrictions in Global := Seq (
15+ Tags .limit(Tags .Test , 1 )
16+ ),
17+ // JVM options for building
18+ scalacOptions ++= Seq (" -encoding" , " UTF-8" , " -deprecation" , " -unchecked" , " -target:jvm-1.6" , " -feature" ),
19+ javaOptions in Test ++= Seq (" -ea" ),
20+ javacOptions in (Compile , compile) ++= Seq (" -encoding" , " UTF-8" , " -Xlint:unchecked" , " -Xlint:deprecation" , " -source" , " 1.6" , " -target" , " 1.6" ),
21+ // Use lenient validation mode when generating Javadoc (for Java8)
22+ javacOptions in doc := {
23+ val opts = Seq (" -source" , " 1.6" )
24+ if (scala.util.Properties .isJavaAtLeast(" 1.8" )) {
25+ opts ++ Seq (" -Xdoclint:none" )
26+ }
27+ else {
28+ opts
29+ }
30+ },
31+ // Release settings
32+ releaseTagName := { (version in ThisBuild ).value },
33+ 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+
51+ // Find bugs
52+ findbugsReportType := Some (ReportType .FancyHtml ),
53+ findbugsReportPath := Some (crossTarget.value / " findbugs" / " report.html" ),
54+
55+ // Style check config: (sbt-jchekcstyle)
56+ jcheckStyleConfig := " facebook" ,
57+
58+ // Run jcheckstyle both for main and test codes
59+ compile <<= (compile in Compile ) dependsOn (jcheckStyle in Compile ),
60+ compile <<= (compile in Test ) dependsOn (jcheckStyle in Test )
1561)
1662
17- incOptions := incOptions.value.withNameHashing(true )
18-
19- // JVM options for building
20- scalacOptions ++= Seq (" -encoding" , " UTF-8" , " -deprecation" , " -unchecked" , " -target:jvm-1.6" , " -feature" )
21-
22- javaOptions in Test ++= Seq (" -ea" )
23- javacOptions in (Compile , compile) ++= Seq (" -encoding" , " UTF-8" , " -Xlint:unchecked" , " -Xlint:deprecation" , " -source" , " 1.6" , " -target" , " 1.6" )
24-
25- // Use lenient validation mode when generating Javadoc (for Java8)
26- javacOptions in doc := {
27- val opts = Seq (" -source" , " 1.6" )
28- if (scala.util.Properties .isJavaAtLeast(" 1.8" )) {
29- opts ++ Seq (" -Xdoclint:none" )
30- }
31- else {
32- opts
33- }
34- }
35-
3663val junitInterface = " com.novocode" % " junit-interface" % " 0.11" % " test"
3764
3865// Project settings
3966lazy val root = Project (id = " msgpack-java" , base = file(" ." ))
4067 .settings(
68+ buildSettings,
4169 // Do not publish the root project
4270 publishArtifact := false ,
4371 publish := {},
@@ -49,6 +77,7 @@ lazy val root = Project(id = "msgpack-java", base = file("."))
4977
5078lazy val msgpackCore = Project (id = " msgpack-core" , base = file(" msgpack-core" ))
5179 .settings(
80+ buildSettings,
5281 description := " Core library of the MessagePack for Java" ,
5382 libraryDependencies ++= Seq (
5483 // msgpack-core should have no external dependencies
@@ -64,6 +93,7 @@ lazy val msgpackCore = Project(id = "msgpack-core", base = file("msgpack-core"))
6493
6594lazy val msgpackJackson = Project (id = " msgpack-jackson" , base = file(" msgpack-jackson" ))
6695 .settings(
96+ buildSettings,
6797 name := " jackson-dataformat-msgpack" ,
6898 description := " Jackson extension that adds support for MessagePack" ,
6999 libraryDependencies ++= Seq (
@@ -73,40 +103,3 @@ lazy val msgpackJackson = Project(id = "msgpack-jackson", base = file("msgpack-j
73103 ),
74104 testOptions += Tests .Argument (TestFrameworks .JUnit , " -v" )
75105 ).dependsOn(msgpackCore)
76-
77-
78- // Release settings
79-
80- import ReleaseTransformations ._
81-
82- releaseTagName := { (version in ThisBuild ).value }
83- releaseProcess := Seq [ReleaseStep ](
84- checkSnapshotDependencies,
85- inquireVersions,
86- runClean,
87- runTest,
88- setReleaseVersion,
89- commitReleaseVersion,
90- tagRelease,
91- ReleaseStep (action = Command .process(" publishSigned" , _)),
92- setNextVersion,
93- commitNextVersion,
94- ReleaseStep (action = Command .process(" sonatypeReleaseAll" , _)),
95- pushChanges
96- )
97-
98- // Jacoco code coverage report
99- jacoco.settings
100- parallelExecution in jacoco.Config := false
101-
102- // Find bugs
103- findbugsSettings
104- findbugsReportType := Some (ReportType .FancyHtml )
105- findbugsReportPath := Some (crossTarget.value / " findbugs" / " report.html" )
106-
107- // Style check config: (sbt-jchekcstyle)
108- jcheckStyleConfig := " facebook"
109-
110- // Run jcheckstyle both for main and test codes
111- compile <<= (compile in Compile ) dependsOn (jcheckStyle in Compile )
112- compile <<= (compile in Test ) dependsOn (jcheckStyle in Test )
0 commit comments