-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sbt
85 lines (78 loc) · 2.98 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 sbtcrossproject.{crossProject, CrossType}
import com.typesafe.sbt.pgp.PgpKeys._
// Project/Maven metadata
name in ThisBuild := "taggy"
version in ThisBuild := "1.0.0"
organization in ThisBuild := "com.acjay"
homepage in ThisBuild := Some(url("https://github.com/acjay/taggy"))
licenses in ThisBuild += ("MIT", url("https://opensource.org/licenses/MIT"))
scmInfo in ThisBuild := Some(
ScmInfo(
url("https://github.com/acjay/taggy"),
"scm:[email protected]:acjay/taggy.git"
)
)
developers in ThisBuild := List(
Developer(
id = "acjay",
name = "Alan Johnson",
email = "[email protected]",
url = url("http://www.acjay.com")
)
)
// Publication config
lazy val publishSettings = Seq(
moduleName := "taggy",
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")
},
publishArtifact in Test := false
)
lazy val noPublishSettings = Seq(
publishTo := Some(Resolver.file("Unused transient repository", target.value / "fakepublish")),
publishArtifact := false,
publishLocal := {},
publishLocalSigned := {}, // doesn't work
publishSigned := {}, // doesn't work
packagedArtifacts := Map.empty
)
// Macro config
lazy val commonSettings: Seq[Def.Setting[_]] = Seq(
crossScalaVersions := Seq("2.11.11", "2.12.3"),
resolvers += Resolver.sonatypeRepo("releases"),
resolvers += Resolver.bintrayRepo("scalameta", "maven"),
libraryDependencies += "org.scalameta" %%% "scalameta" % "1.8.0",
addCompilerPlugin("org.scalameta" % "paradise" % "3.0.0-M10" cross CrossVersion.full),
scalacOptions += "-Xplugin-require:macroparadise",
// temporary workaround for https://github.com/scalameta/paradise/issues/10
scalacOptions in (Compile, console) ~= (_ filterNot (_ contains "paradise"))
)
lazy val root = project.in(file("."))
.aggregate(taggyJS, taggyJVM)
.settings(noPublishSettings)
// Define macros in the root project.
lazy val taggy = crossProject(JSPlatform, JVMPlatform)
.crossType(CrossType.Pure)
.in(file("."))
.settings(
commonSettings,
publishSettings,
name := "taggy")
lazy val taggyJS = taggy.js
lazy val taggyJVM = taggy.jvm
// Declare separate project for demo.
lazy val example = crossProject(JSPlatform, JVMPlatform)
.crossType(CrossType.Full)
.settings(
commonSettings,
noPublishSettings,
name := "taggy-example"
)
.dependsOn(taggy)
lazy val exampleJS = example.js
lazy val exampleJVM = example.jvm