-
Notifications
You must be signed in to change notification settings - Fork 325
Expand file tree
/
Copy pathbuild.sbt
More file actions
135 lines (126 loc) · 5.06 KB
/
build.sbt
File metadata and controls
135 lines (126 loc) · 5.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
Global / onChangedBuildSource := ReloadOnSourceChanges
// For performance testing, ensure each test run one-by-one
Global / concurrentRestrictions := Seq(
Tags.limit(Tags.Test, 1)
)
val AIRFRAME_VERSION = "20.4.1"
// Use dynamic snapshot version strings for non tagged versions
ThisBuild / dynverSonatypeSnapshots := true
// Use coursier friendly version separator
ThisBuild / dynverSeparator := "-"
val buildSettings = Seq[Setting[_]](
organization := "org.msgpack",
organizationName := "MessagePack",
organizationHomepage := Some(new URL("http://msgpack.org/")),
description := "MessagePack for Java",
scalaVersion := "2.12.13",
Test / logBuffered := false,
// msgpack-java should be a pure-java library, so remove Scala specific configurations
autoScalaLibrary := false,
crossPaths := false,
publishMavenStyle := true,
// JVM options for building
scalacOptions ++= Seq("-encoding", "UTF-8", "-deprecation", "-unchecked", "-feature"),
Test / javaOptions ++= Seq("-ea"),
javacOptions ++= Seq("-source", "1.7", "-target", "1.7"),
Compile / compile / javacOptions ++= Seq("-encoding", "UTF-8", "-Xlint:unchecked", "-Xlint:deprecation"),
// Use lenient validation mode when generating Javadoc (for Java8)
doc / javacOptions := {
val opts = Seq("-source", "1.7")
if (scala.util.Properties.isJavaAtLeast("1.8")) {
opts ++ Seq("-Xdoclint:none")
} else {
opts
}
},
// Add sonatype repository settings
publishTo := sonatypePublishToBundle.value,
// Style check config: (sbt-jchekcstyle)
jcheckStyleConfig := "facebook",
// Run jcheckstyle both for main and test codes
Compile / compile := ((Compile / compile) dependsOn (Compile / jcheckStyle)).value,
Test / compile := ((Test / compile) dependsOn (Test / jcheckStyle)).value
)
val junitInterface = "com.novocode" % "junit-interface" % "0.11" % "test"
// Project settings
lazy val root = Project(id = "msgpack-java", base = file("."))
.settings(
buildSettings,
// Do not publish the root project
publishArtifact := false,
publish := {},
publishLocal := {}
)
.aggregate(msgpackCore, msgpackJackson)
lazy val msgpackValue = Project(id = "msgpack-value", base = file("msgpack-value"))
.enablePlugins(SbtOsgi)
.settings(
buildSettings,
description := "Value classes of the MessagePack for Java",
OsgiKeys.bundleSymbolicName := "org.msgpack.msgpack-value",
OsgiKeys.exportPackage := Seq(
// TODO enumerate used packages automatically
"org.msgpack.core",
"org.msgpack.value",
),
libraryDependencies ++= Seq(
// msgpack-value should have no external dependencies
junitInterface,
"org.scalatest" %% "scalatest" % "3.0.3" % "test",
"org.scalacheck" %% "scalacheck" % "1.13.5" % "test",
"org.xerial" %% "xerial-core" % "3.6.0" % "test",
"org.msgpack" % "msgpack" % "0.6.12" % "test",
"commons-codec" % "commons-codec" % "1.10" % "test",
"com.typesafe.akka" %% "akka-actor" % "2.5.7" % "test"
)
)
lazy val msgpackCore = Project(id = "msgpack-core", base = file("msgpack-core"))
.enablePlugins(SbtOsgi)
.settings(
buildSettings,
description := "Core library of the MessagePack for Java",
OsgiKeys.bundleSymbolicName := "org.msgpack.msgpack-core",
OsgiKeys.exportPackage := Seq(
// TODO enumerate used packages automatically
"org.msgpack.core",
"org.msgpack.core.annotations",
"org.msgpack.core.buffer",
"org.msgpack.value",
"org.msgpack.value.impl"
),
testFrameworks += new TestFramework("wvlet.airspec.Framework"),
libraryDependencies ++= Seq(
// msgpack-core should have no external dependencies except for msgpack-value
junitInterface,
"org.wvlet.airframe" %% "airframe-json" % AIRFRAME_VERSION % "test",
"org.wvlet.airframe" %% "airspec" % AIRFRAME_VERSION % "test",
// Add property testing support with forAll methods
"org.scalacheck" %% "scalacheck" % "1.15.4" % "test",
// For performance comparison with msgpack v6
"org.msgpack" % "msgpack" % "0.6.12" % "test",
// For integration test with Akka
"com.typesafe.akka" %% "akka-actor" % "2.5.23" % "test",
"org.scala-lang.modules" %% "scala-collection-compat" % "2.4.3" % "test"
)
)
.dependsOn(msgpackValue)
lazy val msgpackJackson =
Project(id = "msgpack-jackson", base = file("msgpack-jackson"))
.enablePlugins(SbtOsgi)
.settings(
buildSettings,
name := "jackson-dataformat-msgpack",
description := "Jackson extension that adds support for MessagePack",
OsgiKeys.bundleSymbolicName := "org.msgpack.msgpack-jackson",
OsgiKeys.exportPackage := Seq(
"org.msgpack.jackson",
"org.msgpack.jackson.dataformat"
),
libraryDependencies ++= Seq(
"com.fasterxml.jackson.core" % "jackson-databind" % "2.10.5",
junitInterface,
"org.apache.commons" % "commons-math3" % "3.6.1" % "test"
),
testOptions += Tests.Argument(TestFrameworks.JUnit, "-v")
)
.dependsOn(msgpackCore)