forked from haifengl/smile
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
169 lines (149 loc) · 4.83 KB
/
build.sbt
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
name := "smile"
lazy val scala213 = "2.13.11"
lazy val scala3 = "3.3.0"
lazy val supportedScalaVersions = List(scala213, scala3)
lazy val commonSettings = Seq(
// skip packageDoc task on stage
Compile / packageDoc / mappings := Seq(),
// always set scala version including Java only modules
scalaVersion := scala213,
organization := "com.github.haifengl",
organizationName := "Haifeng Li",
organizationHomepage := Some(url("http://haifengl.github.io/")),
version := "3.0.2",
Test / parallelExecution := false,
autoAPIMappings := true,
publishTo := {
val nexus = "https://oss.sonatype.org/"
if (isSnapshot.value)
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
},
Test / publishArtifact := false,
publishMavenStyle := true,
pomIncludeRepository := { _ => false },
pomExtra := (
<url>https://github.com/haifengl/smile</url>
<licenses>
<license>
<name>GNU General Public License, Version 3</name>
<url>https://opensource.org/licenses/GPL-3.0</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<url>[email protected]:haifengl/smile.git</url>
<connection>scm:git:[email protected]:haifengl/smile.git</connection>
</scm>
<developers>
<developer>
<id>haifengl</id>
<name>Haifeng Li</name>
<url>https://haifengl.github.io/</url>
</developer>
</developers>
)
)
lazy val javaSettings = commonSettings ++ Seq(
crossPaths := false,
autoScalaLibrary := false,
Compile / compile / javacOptions ++= Seq(
"-encoding", "UTF8",
"-g:lines,vars,source",
"-Xlint:deprecation",
"-Xlint:unchecked"
),
Compile / doc / javacOptions ++= Seq(
"-Xdoclint:none",
"--allow-script-in-comments",
"-doctitle", """Smile — Statistical Machine Intelligence and Learning Engine""",
"-bottom", """<script src="{@docRoot}/../../js/google-analytics.js" type="text/javascript"></script>"""
),
libraryDependencies ++= Seq(
"org.slf4j" % "slf4j-api" % "2.0.7",
"org.slf4j" % "slf4j-simple" % "2.0.7" % Test,
"junit" % "junit" % "4.13.2" % Test,
"com.novocode" % "junit-interface" % "0.11" % Test exclude("junit", "junit-dep")
),
Test / run / javaOptions ++= Seq(
"--add-opens=java.base/java.lang=ALL-UNNAMED",
"--add-opens=java.base/java.lang.reflect=ALL-UNNAMED",
"--add-opens=java.base/java.nio=ALL-UNNAMED",
),
Test / testOptions := Seq(Tests.Argument(TestFrameworks.JUnit, "-a"))
)
lazy val java8Settings = javaSettings ++ Seq(
Compile / compile / javacOptions ++= Seq(
"-source", "1.8",
"-target", "1.8"
),
)
lazy val java17Settings = javaSettings ++ Seq(
Compile / compile / javacOptions ++= Seq(
"-source", "17",
"-target", "17",
"--enable-preview",
"-Xlint:preview"
),
Compile / doc / javacOptions ++= Seq(
"--enable-preview"
)
)
lazy val scalaSettings = commonSettings ++ Seq(
crossPaths := true,
autoScalaLibrary := true,
crossScalaVersions := supportedScalaVersions,
scalacOptions := Seq(
"-unchecked",
"-deprecation",
"-feature",
"-encoding", "utf8",
"-release:8"
),
Compile / doc / scalacOptions ++= Seq(
"-groups",
"-implicits"
),
libraryDependencies ++= Seq(
"com.typesafe.scala-logging" %% "scala-logging" % "3.9.5",
"org.slf4j" % "slf4j-simple" % "2.0.7" % Test,
"org.specs2" %% "specs2-core" % "4.20.2" % Test
),
)
lazy val root = project.in(file("."))
.settings(commonSettings: _*)
.enablePlugins(JavaUnidocPlugin)
.settings(publish / skip := true)
.settings(crossScalaVersions := Nil)
.settings(
JavaUnidoc / unidoc / unidocProjectFilter := inAnyProject -- inProjects(json, scala, spark, shell, plot)
)
.aggregate(core, base, mkl, nlp, plot, json, scala, spark, shell)
lazy val base = project.in(file("base")).settings(java8Settings: _*)
lazy val mkl = project.in(file("mkl"))
.settings(java8Settings: _*)
.dependsOn(base)
lazy val core = project.in(file("core"))
.settings(java8Settings: _*)
.dependsOn(base % "compile->compile;test->test")
lazy val deep = project.in(file("deep"))
.settings(java8Settings: _*)
.settings(publish / skip := true)
lazy val nlp = project.in(file("nlp"))
.settings(java8Settings: _*)
.dependsOn(core)
lazy val plot = project.in(file("plot"))
.settings(java8Settings: _*)
.dependsOn(base)
lazy val json = project.in(file("json")).settings(scalaSettings: _*)
lazy val scala = project.in(file("scala"))
.settings(scalaSettings: _*)
.dependsOn(core, nlp, plot, json)
lazy val spark = project.in(file("spark"))
.settings(scalaSettings: _*)
.dependsOn(core)
lazy val shell = project.in(file("shell"))
.settings(scalaSettings: _*)
.settings(publish / skip := true)
.dependsOn(scala)