-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathbuild.sbt
118 lines (107 loc) · 3.39 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
import sbtrelease.ReleasePlugin.autoImport.ReleaseTransformations._
resolvers += Resolver.sonatypeRepo("releases")
resolvers += Resolver.sonatypeRepo("snapshots")
val commonSettings = Seq(
organization := "com.github.kenbot",
scalaVersion in ThisBuild := "2.13.0",
crossScalaVersions := Seq("2.12.8", "2.13.0"),
scalacOptions += "-Ywarn-unused:imports",
scalacOptions in (Compile, console) -= "-Ywarn-unused:imports",
scalacOptions in (Test, console) -= "-Ywarn-unused:imports"
)
lazy val goggles = project.in(file("."))
.settings(moduleName := "goggles")
.settings(commonSettings)
.settings(noPublishSettings)
.aggregate(dslProject, macrosProject)
.dependsOn(dslProject, macrosProject)
lazy val macrosProject = (project in file("macros")).settings(
commonSettings,
libraryDependencies += "org.scala-lang" % "scala-reflect" % scalaVersion.value,
libraryDependencies += "com.github.julien-truffaut" %% "monocle-core" % monocleVersion,
libraryDependencies ++= specs2Deps,
publishSettings,
moduleName := "goggles-macros",
scalacOptions += "-Yrangepos",
scalacOptions += "-language:experimental.macros"
)
val specs2Version = "4.6.0"
val specs2Deps = Seq(
"org.specs2" %% "specs2-core" % specs2Version % "test",
"org.specs2" %% "specs2-scalacheck" % specs2Version % "test"
)
val monocleVersion = "1.6.0-RC1"
val monocleDeps = Seq(
"com.github.julien-truffaut" %% "monocle-core" % monocleVersion
)
lazy val dslProject = (project in file("dsl")).
dependsOn(macrosProject).
settings(
commonSettings,
libraryDependencies ++= monocleDeps,
libraryDependencies ++= specs2Deps,
publishSettings,
moduleName := "goggles-dsl",
scalacOptions += "-Yrangepos",
scalacOptions += "-language:experimental.macros"
)
lazy val noPublishSettings = Seq(
publish := {},
publishTo := Some(Resolver.file("delete-me", file("delete-me"))),
publishLocal := {},
publishArtifact := false,
skip in publish := true
)
val publishSettings = Seq(
publishMavenStyle := true,
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")
},
sonatypeProfileName := "com.github.kenbot",
publishArtifact in Test := false,
pomIncludeRepository := { _ => false },
pomExtra := {
<url>https://github.com/kenbot/goggles</url>
<scm>
<url>[email protected]:kenbot/goggles</url>
<connection>scm:git:[email protected]:kenbot/goggles.git</connection>
</scm>
<licenses>
<license>
<name>MIT</name>
<url>https://opensource.org/licenses/MIT</url>
</license>
</licenses>
<developers>
<developer>
<id>kenbot</id>
<name>Ken Scambler</name>
<url>https://github.com/kenbot</url>
</developer>
</developers>
},
releaseCrossBuild := true,
releasePublishArtifactsAction := PgpKeys.publishSigned.value,
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runTest,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
releaseStepCommandAndRemaining("publish"),
setNextVersion,
commitNextVersion,
pushChanges
)
)
initialCommands in dslProject := "import goggles._;"
initialCommands in (dslProject, Test) := """
import goggles._;
import Fixture._;
import testdsl._;
"""