Repository navigation
Expand file tree
/
Copy pathbuild.sbt
More file actions
66 lines (57 loc) · 2.39 KB
/
Copy pathbuild.sbt
File metadata and controls
66 lines (57 loc) · 2.39 KB
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
import Dependencies._
val stackpackName = "splunk"
/*
* General build setup
*
* NOTE: publishing the Splunk StackPack is done by the StackState CI/CD pipeline. Its configuration is included in this build setup
* but requires StackState artifactory credentials which are not available to StackPack contributors.
*/
val host = "artifactory.tooling.stackstate.io"
val realm = "Stackstate Artifactory"
val fileCredentials = Credentials(Path.userHome / ".sbt" / "stackstate-artifactory.credentials")
val publishRealm = "Artifactory Realm"
val publishFileCredentials = Credentials(Path.userHome / ".sbt" / "stackstate-artifactory-publish.credentials")
def getCredentials(realm: String, fallback: Credentials) =
(
for {
user <- sys.env.get("ARTIFACTORY_USERNAME")
pwd <- sys.env.get("ARTIFACTORY_PASSWORD")
} yield Credentials(realm, host, user, pwd)
).getOrElse(fallback)
lazy val root = (project in file("."))
.settings(
inThisBuild(List(
organization := "com.stackstate.stackpack",
updateOptions := updateOptions.value.withGigahorse(false), // Work around for bug: https://github.com/sbt/sbt/issues/3570
scalaVersion := "2.12.11",
scalacOptions ++= Vector(
"-target:jvm-1.8",
"-encoding",
"UTF-8",
"-feature",
"-language:implicitConversions",
"-language:postfixOps",
"-unchecked",
"-deprecation",
"-Xfatal-warnings",
"-Xmax-classfile-name",
"242",
"-Yrangepos"
),
javacOptions ++= Vector("-source", "1.8", "-target", "1.8", "-Xlint:unchecked", "-Xlint:deprecation", "-Werror"),
resolvers ++= Vector("Stackstate Artifactory" at s"https://${host}/artifactory/libs-release", Resolver.mavenLocal),
coursierUseSbtCredentials := true,
// Publishing the Splunk StackPack is done by the StackState CI/CD pipeline.
credentials ++= List(getCredentials(realm, fileCredentials), getCredentials(publishRealm, publishFileCredentials)),
publishTo := Some(publishRealm at s"https://${host}/artifactory/libs"),
// disable publishing the main doc jar
publishArtifact in (Compile, packageDoc) := false,
// disable publishing the main sources jar
publishArtifact in (Compile, packageSrc) := false
)),
name := stackpackName
)
lazy val showVersion = taskKey[Unit]("Show version")
showVersion := {
println(version.value)
}