forked from weso/document
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
137 lines (115 loc) · 3.78 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
lazy val scala212 = "2.12.13"
lazy val scala213 = "2.13.5"
lazy val scalaJs = "0.6.31"
lazy val scala3 = "3.0.0-RC2"
lazy val supportedScalaVersions = List(
scala212,
scala213,
scala3
)
val Java11 = "[email protected]"
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")
lazy val munitVersion = "0.7.23"
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 document = project
.in(file("."))
.enablePlugins(AsciidoctorPlugin,SiteScaladocPlugin,GhpagesPlugin)
// .disablePlugins(RevolverPlugin)
.settings(commonSettings, publishSettings, ghPagesSettings)
.settings(
ThisBuild / turbo := true,
cancelable in Global := true,
fork := true,
coverageHighlighting := true,
testFrameworks += new TestFramework("munit.Framework"),
githubOwner := "weso",
githubRepository := "document"
)
/* ********************************************************
******************** Grouped Settings ********************
**********************************************************/
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"
)
lazy val commonSettings = compilationSettings ++ sharedDependencies ++ Seq(
organization := "es.weso",
resolvers ++= Seq(
Resolver.githubPackages("weso")
),
)
lazy val publishSettings = Seq(
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/")),
publishMavenStyle := true
)