This repository was archived by the owner on Nov 22, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +38
-0
lines changed Expand file tree Collapse file tree 4 files changed +38
-0
lines changed Original file line number Diff line number Diff line change 21
21
run : |
22
22
cd core
23
23
sbt "scalafmtCheckAll; scalafmtSbtCheck"
24
+ cd ../tools
25
+ sbt "scalafmtCheckAll; scalafmtSbtCheck"
24
26
- name : Build documentation
25
27
run : |
26
28
sudo snap install yq
Original file line number Diff line number Diff line change 19
19
run : |
20
20
cd core
21
21
sbt "whitesourceCheckPolicies; whitesourceUpdate"
22
+ cd ../tools
23
+ sbt "whitesourceCheckPolicies; whitesourceUpdate"
22
24
- name : Build documentation
23
25
run : |
24
26
sudo snap install yq
Original file line number Diff line number Diff line change
1
+ import sbt ._
2
+ import sbt .Keys ._
3
+ import sbtwhitesource .WhiteSourcePlugin .autoImport ._
4
+ import sbtwhitesource ._
5
+ import scala .sys .process .Process
6
+ import scala .util .Try
7
+
8
+ object Whitesource extends AutoPlugin {
9
+ private lazy val gitCurrentBranch =
10
+ Try (Process (" git rev-parse --abbrev-ref HEAD" ).!! .replaceAll(" \\ s" , " " )).recover {
11
+ case e => sys.error(s " Couldn't determine git branch for Whitesource: $e" )
12
+ }.toOption
13
+
14
+ override def requires = WhiteSourcePlugin
15
+
16
+ override def trigger = allRequirements
17
+
18
+ override lazy val projectSettings = Seq (
19
+ // do not change the value of whitesourceProduct
20
+ whitesourceProduct := " cloudflow" ,
21
+ whitesourceAggregateProjectName := {
22
+ " cloudflow-tools-" + (
23
+ if (isSnapshot.value)
24
+ if (gitCurrentBranch.contains(" master" )) " master"
25
+ else " adhoc"
26
+ else majorMinor((LocalRootProject / version).value).map(_ + " -stable" ).getOrElse(" adhoc" )
27
+ )
28
+ },
29
+ whitesourceForceCheckAllDependencies := true ,
30
+ whitesourceFailOnError := true )
31
+
32
+ private def majorMinor (version : String ): Option [String ] = """ \d+\.\d+""" .r.findFirstIn(version)
33
+ }
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.10.0")
4
4
// discipline
5
5
addSbtPlugin(" org.scalameta" % " sbt-scalafmt" % " 2.4.2" )
6
6
addSbtPlugin(" de.heikoseeberger" % " sbt-header" % " 5.6.0" )
7
+ addSbtPlugin(" com.lightbend" % " sbt-whitesource" % " 0.1.18" )
7
8
8
9
libraryDependencies ++= Seq (
9
10
" org.codehaus.plexus" % " plexus-container-default" % " 2.1.0" ,
You can’t perform that action at this time.
0 commit comments