From efe6d9615604a88ce8de863c0d0b9ff0cb510fc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20Andr=C3=A9n?= Date: Thu, 19 Sep 2019 15:37:33 +0200 Subject: [PATCH] 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 --- project/Whitesource.scala | 23 ++++++++++++++--------- project/plugins.sbt | 1 - 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/project/Whitesource.scala b/project/Whitesource.scala index 528cfa2887..e67d872ce2 100644 --- a/project/Whitesource.scala +++ b/project/Whitesource.scala @@ -6,7 +6,7 @@ import sbt._ import sbt.Keys._ import sbtwhitesource.WhiteSourcePlugin.autoImport._ import sbtwhitesource._ -import com.typesafe.sbt.SbtGit.GitKeys._ +import scala.sys.process._ object Whitesource extends AutoPlugin { override def requires = WhiteSourcePlugin @@ -17,15 +17,20 @@ object Whitesource extends AutoPlugin { // do not change the value of whitesourceProduct whitesourceProduct := "Lightbend Reactive Platform", whitesourceAggregateProjectName := { - (moduleName in LocalRootProject).value + "-" + ( - if (isSnapshot.value) - if (gitCurrentBranch.value == "master") "master" + 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")) + } else + CrossVersion + .partialVersion((version in LocalRootProject).value) + .map { case (major, minor) => s"$major.$minor-stable" } + .getOrElse("adhoc") + + s"$name-$wsVersionName" }, whitesourceForceCheckAllDependencies := true, - whitesourceFailOnError := true, - ) + whitesourceFailOnError := true) } diff --git a/project/plugins.sbt b/project/plugins.sbt index 6761a59a84..da93f4a0ae 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -19,7 +19,6 @@ addSbtPlugin("com.lightbend.akka" % "sbt-paradox-akka" % "0.24") addSbtPlugin("com.lightbend.paradox" % "sbt-paradox-apidoc" % "0.2") addSbtPlugin("com.lightbend.paradox" % "sbt-paradox" % "0.6.5") addSbtPlugin("com.lightbend" % "sbt-whitesource" % "0.1.16") -addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "1.0.0") addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.2.0") // for maintenance of copyright file header addSbtPlugin("com.hpe.sbt" % "sbt-pull-request-validator" % "1.0.0") addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.0")