Skip to content

Commit 1d6aa47

Browse files
committed
Merge pull request msgpack#295 from xerial/build-sbt
Replace Project.scala with build.sbt
2 parents 65fd3cd + 1381a51 commit 1d6aa47

File tree

5 files changed

+119
-157
lines changed

5 files changed

+119
-157
lines changed

build.sbt

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
import de.johoop.findbugs4sbt.ReportType
2+
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)
15+
)
16+
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+
36+
val junitInterface = "com.novocode" % "junit-interface" % "0.11" % "test"
37+
38+
// Project settings
39+
lazy val root = Project(id = "msgpack-java", base = file("."))
40+
.settings(
41+
// Do not publish the root project
42+
publishArtifact := false,
43+
publish := {},
44+
publishLocal := {},
45+
findbugs := {
46+
// do not run findbugs for the root project
47+
}
48+
).aggregate(msgpackCore, msgpackJackson)
49+
50+
lazy val msgpackCore = Project(id = "msgpack-core", base = file("msgpack-core"))
51+
.settings(
52+
description := "Core library of the MessagePack for Java",
53+
libraryDependencies ++= Seq(
54+
// msgpack-core should have no external dependencies
55+
junitInterface,
56+
"org.scalatest" %% "scalatest" % "2.2.4" % "test",
57+
"org.scalacheck" %% "scalacheck" % "1.12.2" % "test",
58+
"org.xerial" % "xerial-core" % "3.3.6" % "test",
59+
"org.msgpack" % "msgpack" % "0.6.11" % "test",
60+
"commons-codec" % "commons-codec" % "1.10" % "test",
61+
"com.typesafe.akka" %% "akka-actor" % "2.3.9" % "test"
62+
)
63+
)
64+
65+
lazy val msgpackJackson = Project(id = "msgpack-jackson", base = file("msgpack-jackson"))
66+
.settings(
67+
name := "jackson-dataformat-msgpack",
68+
description := "Jackson extension that adds support for MessagePack",
69+
libraryDependencies ++= Seq(
70+
"com.fasterxml.jackson.core" % "jackson-databind" % "2.6.3",
71+
junitInterface,
72+
"org.apache.commons" % "commons-math3" % "3.4.1" % "test"
73+
),
74+
testOptions += Tests.Argument(TestFrameworks.JUnit, "-v")
75+
).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)

msgpack-jackson/src/test/java/org/msgpack/jackson/dataformat/MessagePackParserTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -484,8 +484,10 @@ public void testReadPrimitiveObjectViaObjectMapper()
484484
ObjectMapper objectMapper = new ObjectMapper(new MessagePackFactory());
485485
objectMapper.configure(JsonParser.Feature.AUTO_CLOSE_SOURCE, false);
486486
assertEquals("foo", objectMapper.readValue(in, new TypeReference<String>() {}));
487-
assertEquals(Long.MAX_VALUE, objectMapper.readValue(in, new TypeReference<Long>() {}));
488-
assertEquals(3.14, objectMapper.readValue(in, new TypeReference<Double>() {}));
487+
long l = objectMapper.readValue(in, new TypeReference<Long>() {});
488+
assertEquals(Long.MAX_VALUE, l);
489+
double d = objectMapper.readValue(in, new TypeReference<Double>() {});
490+
assertEquals(3.14, d, 0.001);
489491
byte[] bs = objectMapper.readValue(in, new TypeReference<byte[]>() {});
490492
assertEquals(bytes.length, bs.length);
491493
assertEquals(bytes[0], bs[0]);

project/Build.scala

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

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
sbt.version=0.13.8
1+
sbt.version=0.13.9
22

project/plugins.sbt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

2-
addSbtPlugin("com.github.gseitz" % "sbt-release" % "0.8.5")
2+
addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.0")
33

4-
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "0.5.0")
4+
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "1.0")
55

66
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.0")
77

0 commit comments

Comments
 (0)