This repository has been archived by the owner on Mar 29, 2023. It is now read-only.
forked from Workday/prometheus-akka
-
Notifications
You must be signed in to change notification settings - Fork 10
/
build.sbt
109 lines (86 loc) · 3.1 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
organization := "io.kontainers"
name := "micrometer-akka"
ThisBuild / scalaVersion := "2.13.8"
ThisBuild / crossScalaVersions := Seq("2.12.16", "2.13.8", "3.1.2")
scalacOptions += "-target:jvm-1.8"
def sysPropOrDefault(propName: String, default: String): String = Option(System.getProperty(propName)) match {
case Some(propVal) if !propVal.trim.isEmpty => propVal.trim
case _ => default
}
val akkaVersion = "2.6.18"
val aspectjweaverVersion = "1.9.9.1"
val micrometerVersion = "1.9.0"
update / checksums := Nil
libraryDependencies ++= Seq(
"org.slf4j" % "slf4j-api" % "1.7.36",
"io.micrometer" % "micrometer-core" % micrometerVersion,
"com.typesafe.akka" %% "akka-actor" % akkaVersion,
"com.typesafe.akka" %% "akka-slf4j" % akkaVersion,
"com.typesafe" % "config" % "1.4.2",
"org.aspectj" % "aspectjweaver" % aspectjweaverVersion,
"com.typesafe.akka" %% "akka-cluster" % akkaVersion % Test,
"com.typesafe.akka" %% "akka-testkit" % akkaVersion % Test,
"org.scalatest" %% "scalatest" % "3.2.13" % Test,
"ch.qos.logback" % "logback-classic" % "1.2.11" % Test
)
val scalaReleaseVersion = SettingKey[Int]("scalaReleaseVersion")
scalaReleaseVersion := {
val v = scalaVersion.value
CrossVersion.partialVersion(v).map(_._1.toInt).getOrElse {
throw new RuntimeException(s"could not get Scala release version from $v")
}
}
Compile / unmanagedSourceDirectories ++= {
if (scalaReleaseVersion.value > 2) {
Seq(
(LocalRootProject / baseDirectory).value / "src" / "main" / "scala-3"
)
} else {
Seq(
(LocalRootProject / baseDirectory).value / "src" / "main" / "scala-2"
)
}
}
Test / unmanagedSourceDirectories ++= {
if (scalaReleaseVersion.value > 2) {
Seq(
(LocalRootProject / baseDirectory).value / "src" / "test" / "scala-3"
)
} else {
Seq(
(LocalRootProject / baseDirectory).value / "src" / "test" / "scala-2"
)
}
}
enablePlugins(JavaAgent)
javaAgents += "org.aspectj" % "aspectjweaver" % aspectjweaverVersion % Test
Test / testOptions += Tests.Argument(TestFrameworks.ScalaTest, "-oD")
Test / parallelExecution := false
logBuffered := false
Test / javaOptions += s"""-Dconfig.resource=${sysPropOrDefault("config.resource", "application.conf")}"""
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")
}
Test / publishArtifact := false
pomIncludeRepository := { _ => false }
homepage := Some(url("https://github.com/kontainers/micrometer-akka"))
licenses := Seq("The Apache Software License, Version 2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0.txt"))
releasePublishArtifactsAction := PgpKeys.publishSigned.value
pomExtra := (
<scm>
<url>[email protected]:kontainers/micrometer-akka.git</url>
<connection>scm:git:[email protected]:kontainers/micrometer-akka.git</connection>
</scm>
<developers>
<developer>
<id>pjfanning</id>
<name>PJ Fanning</name>
<url>https://github.com/pjfanning</url>
</developer>
</developers>
)