-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.sbt
99 lines (87 loc) · 2.68 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
val Version = new {
val plugin = "0.2.0-SNAPSHOT"
val sbt10 = "1.3.9"
val scala_native = "0.4.0-SNAPSHOT"
val package_conf = "0.2.0-SNAPSHOT"
val scala211 = "2.11.12"
val scala212 = "2.12.10"
}
lazy val supportedScalaVersions = List(Version.scala212, Version.scala211)
val commonSettings = Seq(
version := Version.plugin,
organization := "de.surfice",
scalacOptions ++= Seq("-deprecation","-unchecked","-feature","-Xlint"),
crossSbtVersions := Seq(Version.sbt10)
)
lazy val embed = project
.settings(commonSettings ++ publishingSettings: _*)
.settings(
name := "scalanative-embed"
)
lazy val plugin = project
.in(file("."))
.enablePlugins(SbtPlugin)
.aggregate(config,embed)
.dependsOn(embed)
.settings(commonSettings ++ publishingSettings: _*)
.settings(
name := "sbt-nbh",
sbtPlugin := true,
scriptedLaunchOpts += "-Dplugin.version=" + version.value,
scriptedBufferLog := false,
addSbtPlugin("org.scala-native" % "sbt-scala-native" % Version.scala_native),
addSbtPlugin("de.surfice" % "sbt-package-conf" % Version.package_conf),
sourceGenerators in Compile += Def.task {
val file = (sourceManaged in Compile).value / "Version.scala"
IO.write(file,
s"""package de.surfice.sbt.nbh
|object Versions {
| val plugin = "${version.value}"
|}
""".stripMargin)
Seq(file)
}.taskValue
)
lazy val config = project
.settings(commonSettings ++ publishingSettings: _*)
.settings(
name := "sbt-nbh-config",
crossScalaVersions := supportedScalaVersions //scalaVersion := Version.scala211
)
lazy val publishingSettings = 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")
},
pomExtra := (
<url>https://github.com/jokade/sbt-nbh</url>
<licenses>
<license>
<name>MIT License</name>
<url>http://www.opensource.org/licenses/mit-license.php</url>
</license>
</licenses>
<scm>
<url>[email protected]:jokade/sbt-nbh</url>
<connection>scm:git:[email protected]:jokade/sbt-nbh.git</connection>
</scm>
<developers>
<developer>
<id>jokade</id>
<name>Johannes Kastner</name>
<email>[email protected]</email>
</developer>
</developers>
)
)
lazy val dontPublish = Seq(
publish := {},
publishLocal := {},
publish / skip := true,
publishArtifact := false,
publishTo := Some(Resolver.file("Unused transient repository",file("target/unusedrepo")))
)