-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy pathbuild.sbt
More file actions
134 lines (124 loc) · 4.64 KB
/
build.sbt
File metadata and controls
134 lines (124 loc) · 4.64 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
import xerial.sbt.Sonatype._
Global / onChangedBuildSource := ReloadOnSourceChanges
sonatypeProfileName := "org.xerial"
val CROSS_SCALA_VERSIONS = Seq("2.12.17", "2.13.10", "3.2.1")
ThisBuild / scalaVersion := "3.2.1"
val buildSettings = Seq(
organization := "org.xerial.larray",
organizationName := "xerial.org",
publishMavenStyle := true,
Test / publishArtifact := false,
crossScalaVersions := CROSS_SCALA_VERSIONS,
Test / logBuffered := false,
parallelExecution := true,
Test / parallelExecution := false,
Compile / javacOptions ++= Seq("-Xlint:unchecked"),
Compile / doc / javacOptions := Seq(
"-locale",
"en_US",
"-sourcepath",
baseDirectory.value.getAbsolutePath,
"-doctitle",
s"LArray ${version.value} API"
),
scalacOptions ++= Seq("-encoding", "UTF-8", "-unchecked", "-deprecation", "-feature"),
Compile / doc / scalacOptions ++= Seq(
"-sourcepath",
baseDirectory.value.getAbsolutePath,
"-doc-source-url",
"https://github.com/xerial/larray/tree/develop/€{FILE_PATH}.scala",
"-doc-title",
"LArray API",
"-doc-version",
version.value,
"-diagrams"
),
libraryDependencies ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, major)) if major <= 12 =>
Seq()
case _ =>
Seq("org.scala-lang.modules" %% "scala-parallel-collections" % "1.0.4")
}
} ++
Seq(
"org.scala-lang.modules" %% "scala-collection-compat" % "2.8.1",
"org.wvlet.airframe" %% "airspec" % "22.11.4" % "test"
),
testFrameworks += new TestFramework("wvlet.airspec.Framework"),
crossPaths := true,
licenses += ("Apache-2.0", url("https://www.apache.org/licenses/LICENSE-2.0.html")),
sonatypeProjectHosting := Some(GitHubHosting("xerial", "larray", "leo@xerial.org")),
publishTo := sonatypePublishToBundle.value
)
lazy val root = project
.in(file("."))
.settings(buildSettings)
.settings(
name := "larray-root",
publish := {},
publishLocal := {},
publishArtifact := false
)
.aggregate(larrayScala, larrayBuffer, larrayMMap)
val snappy = "org.xerial.snappy" % "snappy-java" % "1.1.4"
val junit = "junit" % "junit" % "4.11" % "test"
val slf4j = "org.slf4j" % "slf4j-api" % "1.7.25"
val slf4jSimple = "org.slf4j" % "slf4j-simple" % "1.7.25"
val scope = "test->test;compile->compile"
lazy val larrayScala =
project
.in(file("larray"))
.settings(buildSettings)
.enablePlugins(MultiJvmPlugin)
.configs(MultiJvm)
.settings(
name := "larray",
description := "LArray: A Large off-heap arrays for Scala/Java",
MultiJvm / logBuffered := false,
MultiJvm / jvmOptions ++= Seq("-Xmx128M"),
MultiJvm / compile := { (MultiJvm / compile) triggeredBy (Test / compile) }.value,
Test / executeTests := {
val testResults: Tests.Output = (Test / executeTests).value
val multiJvmTestResults: Tests.Output = (MultiJvm / executeTests).value
val results = testResults.events ++ multiJvmTestResults.events
Tests.Output(
Tests.overall(Seq(testResults.overall, multiJvmTestResults.overall)),
results,
testResults.summaries ++ multiJvmTestResults.summaries
)
},
libraryDependencies ++= Seq(
// Add dependent jars here
"org.wvlet.airframe" %% "airframe-log" % "22.11.4",
snappy % "test",
junit,
"org.iq80.snappy" % "snappy" % "0.3" % "test",
"com.github.sbt" % "junit-interface" % "0.13.3" % "test",
"org.scalatest" %% "scalatest" % "3.2.14" % "test",
"org.scalacheck" %% "scalacheck" % "1.15.4" % "test",
"com.typesafe.akka" %% "akka-testkit" % "2.7.0" % "test",
"com.typesafe.akka" %% "akka-multi-node-testkit" % "2.7.0" % "test"
)
).dependsOn(larrayBuffer % scope)
lazy val larrayBuffer = project
.in(file("larray-buffer"))
.settings(buildSettings)
.settings(
name := "larray-buffer",
description := "LArray off-heap buffer library",
crossPaths := false,
autoScalaLibrary := false
)
lazy val larrayMMap = project
.in(file("larray-mmap"))
.settings(buildSettings)
.settings(
description := "LArray mmap implementation",
crossPaths := false,
autoScalaLibrary := false,
libraryDependencies ++= Seq(
snappy % "test",
junit
)
).dependsOn(larrayBuffer % scope)