pekko/project/Whitesource.scala
Johan Andrén efe6d96156 Use git from the path instead of jgit/sbt-git (#27756)
* Use git from the path instead of jgit/sbt-git
* Branch name extraction working with older git
2019-09-19 15:37:33 +02:00

36 lines
1.1 KiB
Scala

/*
* Copyright (C) 2018-2019 Lightbend Inc. <https://www.lightbend.com>
*/
import sbt._
import sbt.Keys._
import sbtwhitesource.WhiteSourcePlugin.autoImport._
import sbtwhitesource._
import scala.sys.process._
object Whitesource extends AutoPlugin {
override def requires = WhiteSourcePlugin
override def trigger = allRequirements
override lazy val projectSettings = Seq(
// do not change the value of whitesourceProduct
whitesourceProduct := "Lightbend Reactive Platform",
whitesourceAggregateProjectName := {
val name = (moduleName in LocalRootProject).value
val wsVersionName =
if (isSnapshot.value) {
val currentGitBranch = "git rev-parse --abbrev-ref HEAD".!!.trim
if (currentGitBranch == "master") "master"
else "adhoc"
} else
CrossVersion
.partialVersion((version in LocalRootProject).value)
.map { case (major, minor) => s"$major.$minor-stable" }
.getOrElse("adhoc")
s"$name-$wsVersionName"
},
whitesourceForceCheckAllDependencies := true,
whitesourceFailOnError := true)
}