This repository has been archived by the owner on Sep 28, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
127 lines (111 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
119
120
121
122
123
124
125
126
127
lazy val standardSettings = Seq(
organization := "info.hupel",
scalaVersion := "2.12.4",
javacOptions += "-Xlint:unchecked",
homepage := Some(url("https://github.com/larsrh/sbt-jsr223/")),
licenses := Seq(
"Apache-2.0" -> url("http://opensource.org/licenses/Apache-2.0")
),
publishArtifact in Test := false,
pomIncludeRepository := { _ => false },
resolvers += Resolver.sonatypeRepo("releases"),
publishTo := {
val nexus = "https://oss.sonatype.org/"
if (version.value.endsWith("SNAPSHOT"))
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
},
pomExtra := (
<developers>
<developer>
<id>larsrh</id>
<name>Lars Hupel</name>
<url>http://lars.hupel.info</url>
</developer>
</developers>
<scm>
<connection>scm:git:github.com/larsrh/sbt-jsr223.git</connection>
<developerConnection>scm:git:git@github.com:larsrh/sbt-jsr223.git</developerConnection>
<url>https://github.com/larsrh/sbt-jsr223</url>
</scm>
),
credentials += Credentials(
Option(System.getProperty("build.publish.credentials")) map (new File(_)) getOrElse (Path.userHome / ".ivy2" / ".credentials")
)
)
lazy val noPublishSettings = Seq(
publish := (()),
publishLocal := (()),
publishArtifact := false
)
lazy val scriptedSettings = Seq(
scriptedLaunchOpts += s"-Dproject.version=${version.value}",
scriptedBufferLog := false
)
lazy val jythonVersion = settingKey[String]("Jython version")
jythonVersion in ThisBuild := "2.7.1"
lazy val root = project.in(file("."))
.settings(standardSettings)
.settings(noPublishSettings)
.aggregate(launcher, plugin, jython)
lazy val launcher = project.in(file("launcher"))
.settings(standardSettings)
.settings(
moduleName := "jsr223-launcher",
autoScalaLibrary := false,
crossPaths := false,
libraryDependencies ++= Seq(
"org.specs2" %% "specs2-core" % "4.0.2" % Test,
"org.python" % "jython-standalone" % jythonVersion.value % Test
)
)
lazy val plugin = project.in(file("plugin"))
.enablePlugins(BuildInfoPlugin)
.settings(standardSettings)
.settings(scriptedSettings)
.settings(
moduleName := "sbt-jsr223",
sbtPlugin := true,
buildInfoKeys := Seq[BuildInfoKey](
version,
moduleName in launcher,
organization,
jythonVersion
),
buildInfoPackage := "info.hupel.jsr223.sbt",
libraryDependencies += "org.apache.commons" % "commons-text" % "1.1",
scripted := {
// we need to publish launcher first, because the plugin pulls it in as
// a dependency
(publishLocal in launcher).value
scripted.evaluated
}
)
lazy val jython = project.in(file("jython"))
.dependsOn(plugin)
.settings(standardSettings)
.settings(scriptedSettings)
.settings(
moduleName := "sbt-jython",
sbtPlugin := true,
libraryDependencies += "org.python" % "jython-standalone" % jythonVersion.value
)
// Release stuff
import ReleaseTransformations._
releaseVcsSign := true
releaseCrossBuild := true
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
releaseStepCommand("publishSigned"),
setNextVersion,
commitNextVersion,
releaseStepCommand("sonatypeRelease")
)
// Miscellaneous
cancelable in Global := true