-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.sbt
198 lines (173 loc) · 5.73 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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
lazy val scala212 = "2.12.15"
lazy val scala213 = "2.13.7"
lazy val scalaJs = "0.6.31"
lazy val scala3 = "3.1.0"
lazy val supportedScalaVersions = List(
scala212,
scala213,
scala3
)
val Java8 = "[email protected]"
val Java11 = "[email protected]"
ThisBuild / githubWorkflowJavaVersions := Seq(Java8)
ThisBuild / crossScalaVersions := supportedScalaVersions
// ThisBuild / scalaVersion := crossScalaVersions.value.last
// ThisBuild / githubWorkflowJavaVersions := Seq(Java11)
// ThisBuild / githubWorkflowScalaVersions := (ThisBuild / crossScalaVersions).value.tail
// ThisBuild / githubWorkflowPublishTargetBranches := Seq(RefPredicate.Equals(Ref.Branch("master")), RefPredicate.StartsWith(Ref.Tag("v")))
/* ThisBuild / githubWorkflowBuild := Seq(
/* WorkflowStep
.Use(UseRef.Public("ruby", "setup-ruby", "v1"), params = Map("ruby-version" -> "2.7"), name = Some("Set up Ruby")),
WorkflowStep.Run(
List("gem install sass", "gem install jekyll -v 4.0.0"),
name = Some("Install Jekyll")
), */
WorkflowStep.Sbt(
List(
"clean",
"coverage"
),
id = None,
name = Some("Test")
),
WorkflowStep.Sbt(
List("coverageReport"),
id = None,
name = Some("Coverage")
),
WorkflowStep.Use(
UseRef.Public(
"codecov",
"codecov-action",
"v1"
)
)
) */
ThisBuild / versionScheme := Some("early-semver")
// Dependencies
lazy val munitVersion = "0.7.27"
lazy val munit = "org.scalameta" %% "munit" % munitVersion % Test
def priorTo2_13(scalaVersion: String): Boolean =
CrossVersion.partialVersion(scalaVersion) match {
case Some((2, minor)) if minor < 13 => true
case _ => false
}
lazy val rootDocument = project
.in(file("."))
.settings(publish / skip := true)
.aggregate(document,docs)
lazy val document = project
.in(file("modules/document"))
.settings(
commonSettings,
ThisBuild / turbo := true,
cancelable in Global := true,
fork := true,
testFrameworks += new TestFramework("munit.Framework"),
)
/* Docs generation */
lazy val docs = project
.in(file("document-docs"))
.settings(
publish / skip := true,
mdocSettings,
ScalaUnidoc / unidoc / unidocProjectFilter := inAnyProject -- inProjects(noDocProjects: _*)
)
.dependsOn(document)
.enablePlugins(MdocPlugin, DocusaurusPlugin, ScalaUnidocPlugin)
lazy val mdocSettings = Seq(
mdocVariables := Map(
"VERSION" -> version.value
),
ScalaUnidoc / unidoc / target := (LocalRootProject / baseDirectory).value / "website" / "static" / "api",
cleanFiles += (ScalaUnidoc / unidoc / target).value,
docusaurusCreateSite := docusaurusCreateSite
.dependsOn(Compile / unidoc)
.value,
docusaurusPublishGhpages :=
docusaurusPublishGhpages
.dependsOn(Compile / unidoc)
.value,
ScalaUnidoc / unidoc / scalacOptions ++= Seq(
"-doc-source-url", s"https://github.com/weso/srdf/tree/v${(ThisBuild / version).value}€{FILE_PATH}.scala",
"-sourcepath", (LocalRootProject / baseDirectory).value.getAbsolutePath,
"-doc-title", "SRDF",
"-doc-version", s"v${(ThisBuild / version).value}"
)
)
/* Grouped Settings */
lazy val noDocProjects = Seq[ProjectReference]()
lazy val sharedDependencies = Seq(
libraryDependencies ++= Seq(
munit
)
)
val compilerOptions = Seq(
"-deprecation",
"-encoding", "UTF-8",
"-feature",
"-language:existentials",
"-language:higherKinds",
"-unchecked",
"-Ywarn-dead-code",
"-Ywarn-numeric-widen",
"-Xfuture",
"-Yno-predef",
"-Ywarn-unused-import"
)
lazy val compilationSettings = Seq(
// scalaVersion := scala3,
// format: off
scalacOptions ++= Seq(
"-deprecation", // Emit warning and location for usages of deprecated APIs.
"-feature", // Emit warning and location for usages of features that should be imported explicitly. "-encoding", "UTF-8",
"-language:_",
"-unchecked", // Enable additional warnings where generated code depends on assumptions.
"-Xfatal-warnings"
)
// format: on
)
lazy val ghPagesSettings = Seq(
git.remoteRepo := "[email protected]:weso/document.git"
)
/**********************************************************
******************** Sonatype Settings *******************
**********************************************************/
inThisBuild(List(
organization := "es.weso",
homepage := Some(url("https://github.com/weso/document")),
licenses := Seq("MIT" -> url("http://opensource.org/licenses/MIT")),
developers := List(
Developer(
id="labra",
name="Jose Emilio Labra Gayo",
email="[email protected]",
url=url("https://weso.labra.es")
)
)
))
lazy val commonSettings = compilationSettings ++ sharedDependencies ++ Seq(
/*organization := "es.weso",
sonatypeProfileName := ("es.weso"),
publishMavenStyle := true,
homepage := Some(url("https://github.com/weso/document")),
licenses := Seq("MIT" -> url("http://opensource.org/licenses/MIT")),
scmInfo := Some(ScmInfo(url("https://github.com/weso/document"), "scm:git:[email protected]:weso/document.git")),
autoAPIMappings := true,
apiURL := Some(url("http://weso.github.io/utils/latest/api/")),
autoAPIMappings := true,
developers := List(
Developer(
id="labra",
name="Jose Emilio Labra Gayo",
email="[email protected]",
url=url("https://weso.labra.es")
)),
ThisBuild / 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")
}*/
)