-
Notifications
You must be signed in to change notification settings - Fork 20
/
build.sbt
100 lines (88 loc) · 3.29 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
name := "Xtract"
val scalaVersions = Seq("2.13.6", "2.12.15")
def versionedScalacOptions(scalaVersion: String) = {
Seq(
"-deprecation",
"-feature",
"-language:higherKinds",
"-Xfatal-warnings"
) ++ (if (scalaVersion.startsWith("2.13")) {
Nil
} else {
Seq("-Ypartial-unification")
})
}
def apiUrl(name: String) = Some(url(s"https://lucidsoftware.github.io/xtract/$name/api/"))
inThisBuild(Seq(
credentials += Credentials("Sonatype Nexus Repository Manager", "oss.sonatype.org", System.getenv("SONATYPE_USERNAME"), System.getenv("SONATYPE_PASSWORD")),
developers ++= List(
Developer("tmccombs", "Thayne McCombs", "", url("https://github.com/tmccombs")),
Developer("", "Andy Hurd", "", null)
),
licenses += "Apache License, Version 2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0"),
homepage := Some(url("https://github.com/lucidsoftware/xtract")),
organization := "com.lucidchart",
scmInfo := Some(ScmInfo(url("https://github.com/lucidsoftware/xtract"), "scm:git:git@github.com:lucidsoftware/xtract.git")),
version := sys.props.getOrElse("build.version", "0-SNAPSHOT"),
sonatypeSessionName := s"[sbt-sonatype] xtract-${scalaBinaryVersion.value}-${version.value}",
autoAPIMappings := true
))
lazy val commonSettings = Seq(
scalacOptions ++= versionedScalacOptions(scalaVersion.value),
publishTo := sonatypePublishToBundle.value
)
lazy val specs2Dependency = Seq(
"org.specs2" %% "specs2-core" % "4.12.12",
"org.specs2" %% "specs2-mock" % "4.12.12"
)
lazy val catsDependency = Seq(
"org.typelevel" %% "cats-macros" % "2.1.1",
"org.typelevel" %% "cats-core" % "2.6.1"
)
lazy val xtract = (projectMatrix in file("xtract-core"))
.settings(
name := "xtract",
commonSettings,
description := "Library to deserialize Xml to user types.",
apiURL := apiUrl("core"),
libraryDependencies ++= catsDependency ++ Seq(
"org.scala-lang.modules" %% "scala-xml" % "2.0.1",
"org.scala-lang.modules" %% "scala-collection-compat" % "2.5.0"
)
)
.jvmPlatform(scalaVersions = scalaVersions)
lazy val xtractMacros = (projectMatrix in file("macros"))
.dependsOn(xtract)
.settings(
name := "xtract-macros",
commonSettings,
description := "Macros for creating XmlReaders.",
apiURL := apiUrl("macros"),
libraryDependencies += "org.scala-lang" % "scala-reflect" % scalaVersion.value
)
.jvmPlatform(scalaVersions = scalaVersions)
lazy val xtractTesting = (projectMatrix in file("testing"))
.dependsOn(xtract)
.settings(
name := "xtract-testing",
commonSettings,
description := "Specs2 matchers for xtract.",
apiURL := apiUrl("testing"),
libraryDependencies ++= specs2Dependency
)
.jvmPlatform(scalaVersions = scalaVersions)
// we have a seperate project for tests, so that we can depend on
// xtract-testing
lazy val allTests = (projectMatrix in file("unit-tests"))
.dependsOn(xtract % "test", xtractMacros % "test", xtractTesting % "test")
.settings(
publish / skip := true,
libraryDependencies ++= specs2Dependency map (_ % "test")
)
.jvmPlatform(scalaVersions = scalaVersions)
lazy val root = (project in file("."))
.aggregate(xtract.projectRefs ++ xtractMacros.projectRefs ++ xtractTesting.projectRefs ++ allTests.projectRefs: _*)
.settings(
commonSettings,
publish / skip:= true
)