forked from sbt/sbt-sbom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
64 lines (63 loc) · 2.06 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
ThisBuild / scalaVersion := "2.12.20"
ThisBuild / versionScheme := Some("early-semver")
ThisBuild / organization := "de.lhns"
ThisBuild / version := {
val Tag = "refs/tags/v?([0-9]+(?:\\.[0-9]+)+(?:[+-].*)?)".r
sys.env
.get("CI_VERSION")
.collect { case Tag(tag) => tag }
.getOrElse("0.4.0-SNAPSHOT")
}
ThisBuild / licenses += ("MIT License", url("https://opensource.org/licenses/MIT"))
ThisBuild / homepage := scmInfo.value.map(_.browseUrl)
ThisBuild / scmInfo := Some(
ScmInfo(
url("https://github.com/lhns/sbt-bom"),
"scm:[email protected]:lhns/sbt-bom.git"
)
)
ThisBuild / developers := List(
Developer(
id = "siculo",
name = "Fabrizio Di Giuseppe",
email = "[email protected]",
url = url("https://github.com/siculo")
),
Developer(
id = "lhns",
name = "Pierre Kisters",
email = "[email protected]",
url = url("https://github.com/lhns/")
)
)
ThisBuild / description := "SBT plugin to generate CycloneDx SBOM files"
ThisBuild / publishMavenStyle := true
ThisBuild / publishTo := sonatypePublishToBundle.value
ThisBuild / sonatypeCredentialHost := "s01.oss.sonatype.org"
ThisBuild / credentials ++= (for {
username <- sys.env.get("SONATYPE_USERNAME")
password <- sys.env.get("SONATYPE_PASSWORD")
} yield Credentials(
"Sonatype Nexus Repository Manager",
sonatypeCredentialHost.value,
username,
password
)).toList
lazy val root = (project in file("."))
.enablePlugins(ScriptedPlugin, BuildInfoPlugin)
.settings(
name := "sbt-bom",
sbtPlugin := true,
libraryDependencies ++= Seq(
"org.cyclonedx" % "cyclonedx-core-java" % "9.0.5",
"io.circe" %% "circe-generic" % "0.14.10",
"io.circe" %% "circe-parser" % "0.14.10",
"org.scalatest" %% "scalatest" % "3.2.19" % Test,
"org.scalamock" %% "scalamock" % "6.0.0" % Test
),
buildInfoPackage := "io.github.siculo.sbtbom",
scriptedLaunchOpts := {
scriptedLaunchOpts.value ++ Seq("-Xmx1024M", "-Dplugin.version=" + version.value, "-Dplugin.organization=" + organization.value)
},
scriptedBufferLog := false
)