-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
121 lines (93 loc) · 3.66 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
val repo = "eie"
name := repo
libraryDependencies ++= List(
"org.scalatest" %% "scalatest" % "3.2.10" % Test,
"org.pegdown" % "pegdown" % "1.6.0" % Test,
"junit" % "junit" % "4.13.2" % Test,
"com.vladsch.flexmark" % "flexmark-profile-pegdown" % "0.62.2" % Test,
"javax.xml.bind" % "jaxb-api" % "2.3.1" % "provided"
)
val username = "aaronp"
organization := s"com.github.${username}"
ThisBuild / scalaVersion := "3.1.0"
ThisBuild / resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots"
enablePlugins(GitVersioning)
enablePlugins(GhpagesPlugin)
enablePlugins(PamfletPlugin)
enablePlugins(SiteScaladocPlugin)
sourceDirectory in Pamflet := sourceDirectory.value / "site"
autoAPIMappings := true
exportJars := false
javacOptions ++= Seq("-source", "1.8", "-target", "1.8", "-XX:MaxMetaspaceSize=1g")
git.useGitDescribe := false
// coverallsTokenFile := Option((Path.userHome / ".sbt" / ".coveralls.eie").asPath.toString)
//scalacOptions ++= List(scalaVersion.value)
// .filter(_.contains("2.13"))
// .map(_ => "-Ymacro-annotations")
ThisBuild / scalacOptions ++= List(
"-language:implicitConversions",
// "-source:3.0-migration",
// "-rewrite",
// "-new-syntax",
// "-indent",
)
//addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.0" cross CrossVersion.full)
buildInfoKeys := Seq[BuildInfoKey](name, version, scalaVersion, sbtVersion)
buildInfoPackage := s"${repo}.build"
// see http://www.scalatest.org/user_guide/using_scalatest_with_sbt
Test / testOptions += (Tests.Argument(TestFrameworks.ScalaTest, "-h", s"target/scalatest-reports", "-oN"))
// see https://www.scala-sbt.org/sbt-site/api-documentation.html
SiteScaladoc / siteSubdirName := "api/latest"
scalacOptions in (Compile, doc) ++= Seq("-groups", "-implicits")
packageOptions in (Compile, packageBin) += Package.ManifestAttributes("git-sha" -> git.gitHeadCommit.value.getOrElse("unknown"))
git.gitTagToVersionNumber := { tag: String =>
if (tag matches "v?[0-9]+\\..*") {
Some(tag)
} else None
}
coverageMinimum := 80
coverageFailOnMinimum := true
// see http://scalameta.org/scalafmt/
ThisBuild / scalafmtOnCompile := true
ThisBuild / scalafmtVersion := "1.4.0"
// Define a `Configuration` for each project, as per http://www.scala-sbt.org/sbt-site/api-documentation.html
//val Api = config("api")
// see https://github.com/sbt/sbt-ghpages
// this exposes the 'ghpagesPushSite' task
git.remoteRepo := s"[email protected]:$username/$repo.git"
ghpagesNoJekyll := true
lazy val settings = scalafmtSettings
releasePublishArtifactsAction := PgpKeys.publishSigned.value
test in assembly := {}
credentials += Credentials(Path.userHome / ".sbt" / ".credentials")
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")
}
publishMavenStyle := true
// see https://leonard.io/blog/2017/01/an-in-depth-guide-to-deploying-to-maven-central/
pomIncludeRepository := (_ => false)
// To sync with Maven central, you need to supply the following information:
Global / pomExtra := {
<url>https://github.com/${username}/${repo}
</url>
<licenses>
<license>
<name>Apache 2</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
</licenses>
<developers>
<developer>
<id>
${username}
</id>
<name>Aaron Pritzlaff</name>
<url>https://github.com/${username}/${repo}
</url>
</developer>
</developers>
}