-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
85 lines (79 loc) · 2.87 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
import Dependencies._
import xerial.sbt.Sonatype._
addCommandAlias("scalafixcheck", "; compile:scalafix --check ; test:scalafix --check")
val projectName = "scala-faker"
val githubId = "stevenchen3"
val githubBaseUrl = "https://github.com"
val githubUrl = s"${githubBaseUrl}/stevenchen3"
val emailAddress = "[email protected]"
val fullName = "Steven Chen"
lazy val commonSettings = Seq(
name := projectName,
scalacOptions in Compile ++= Seq(
"-encoding",
"UTF-8",
"-target:jvm-1.8",
"-Yrangepos",
"-Ywarn-unused-import"
),
javacOptions in Compile ++= Seq("-source", "1.8", "-target", "1.8"),
javaOptions in Test ++= Seq("-Xms256m", "-Xmx2g"),
resolvers ++= Seq(
Resolver.sonatypeRepo("releases"),
Resolver.typesafeRepo("releases")
),
addCompilerPlugin(scalafixSemanticdb)
)
val licenseName = "BSD-3-Clause"
val licenseUrl = "https://opensource.org/licenses/BSD-3-Clause"
lazy val headerSettings = Seq(
organizationName := fullName,
startYear := Some(2019),
licenses += (licenseName, new URL(licenseUrl))
)
lazy val publishSettings = Seq(
organization := s"com.github.${githubId}",
organizationName := fullName,
organizationHomepage := Some(url(githubUrl)),
scmInfo := Some(
ScmInfo(
url(s"${githubBaseUrl}/${githubId}/${projectName}"),
s"scm:[email protected]:${githubId}/${projectName}.git"
)
),
developers := List(
Developer(
id = githubId,
name = fullName,
email = emailAddress,
url = url(githubUrl)
)
),
description := "Scala fake data generator library",
licenses := List(licenseName -> new URL(licenseUrl)),
homepage := Some(url(s"${githubBaseUrl}/${githubId}/${projectName}")),
// Remove all additional repository other than Maven Central from POM
pomIncludeRepository := { _ ⇒ false },
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")
},
// Sync with Maven central
publishMavenStyle := true,
publishArtifact in Test := false,
PgpKeys.useGpg := true,
sonatypeProjectHosting := Some(GitHubHosting(githubId, projectName, emailAddress))
)
lazy val root = Project(id = projectName, base = file("."))
.enablePlugins(AutomateHeaderPlugin)
.settings(crossScalaVersions := Seq("2.11.12", "2.12.8"))
.settings(commonSettings ++ headerSettings ++ publishSettings)
.settings(fork in run := true)
.settings(fork in Test := true)
.settings(coverageEnabled := true) // set to 'false' when publish
.settings(libraryDependencies ++= circeDeps)
.settings(libraryDependencies ++= jodaTimeDeps)
.settings(libraryDependencies ++= jodaConvertDeps)
.settings(libraryDependencies ++= scalatestDeps)
.settings(libraryDependencies ++= typesafeConfigDeps)