-
Notifications
You must be signed in to change notification settings - Fork 91
/
build.sbt
68 lines (59 loc) · 2.49 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
import java.io.FileInputStream
import java.util.Properties
val jmhVersion = {
val props = new Properties()
val is = new FileInputStream(new File("sbt-jmh.properties"))
props.load(is)
is.close()
props.get("jmh.version").toString
}
val commonSettings = Seq(
organization := "pl.project13.scala",
publishTo := Some(if (isSnapshot.value) Opts.resolver.sonatypeOssSnapshots.last else Opts.resolver.sonatypeStaging),
startYear := Some(2014),
licenses += ("Apache-2.0", url("http://www.apache.org/licenses/LICENSE-2.0.html")),
homepage := Some(url("https://github.com/sbt/sbt-jmh")),
scmInfo := Some(ScmInfo(url("https://github.com/sbt/sbt-jmh"), "git@github.com:sbt/sbt-jmh.git")),
developers := List(
Developer("ktoso", "Konrad 'ktoso' Malawski", "<ktoso@project13.pl>", url("https://github.com/ktoso")),
Developer("retronym", "Jason Zaugg", "<jzaugg@gmail.com>", url("https://github.com/retronym")),
Developer("johanandren", "Johan Andrén", "<johan@markatta.com>", url("https://github.com/johanandren"))
),
crossSbtVersions := Vector("1.3.0"),
scalacOptions ++= List(
"-unchecked",
"-deprecation",
"-language:_",
"-encoding", "UTF-8"
),
publishConfiguration := {
val javaVersion = System.getProperty("java.specification.version")
if (javaVersion != "1.8")
throw new RuntimeException("Cancelling publish, please use JDK 1.8")
publishConfiguration.value
},
libraryDependencies += "org.openjdk.jmh" % "jmh-core" % jmhVersion, // GPLv2 with classpath exception
libraryDependencies += "org.openjdk.jmh" % "jmh-generator-bytecode" % jmhVersion, // GPLv2 with classpath exception
libraryDependencies += "org.openjdk.jmh" % "jmh-generator-reflection" % jmhVersion, // GPLv2 with classpath exception
libraryDependencies += "org.openjdk.jmh" % "jmh-generator-asm" % jmhVersion // GPLv2 with classpath exception
)
// sbt-scripted settings
val myScriptedSettings = Seq(
scriptedLaunchOpts += s"-Dproject.version=${version.value}"
)
// ---------------------------------------------------------------------------------------------------------------------
lazy val root =
project
.in(file("."))
.settings(commonSettings: _*)
.settings(publish / skip := true)
.aggregate(plugin)
lazy val plugin = project
.in(file("plugin"))
.settings(commonSettings: _*)
.enablePlugins(SbtPlugin)
.settings(myScriptedSettings: _*)
.settings(
name := "sbt-jmh",
sbtPlugin := true,
).enablePlugins(AutomateHeaderPlugin)