@@ -3,14 +3,15 @@ package scala.build.actionable
3
3
import coursier .Versions
4
4
import coursier .core .{Latest , Version }
5
5
import coursier .parse .RepositoryParser
6
- import dependency ._
6
+ import dependency .*
7
7
8
8
import scala .build .EitherCps .{either , value }
9
9
import scala .build .Positioned
10
- import scala .build .actionable .ActionableDiagnostic ._
10
+ import scala .build .actionable .ActionableDiagnostic .*
11
11
import scala .build .actionable .errors .ActionableHandlerError
12
12
import scala .build .errors .{BuildException , RepositoryFormatError }
13
- import scala .build .internal .Util ._
13
+ import scala .build .internal .Constants
14
+ import scala .build .internal .Util .*
14
15
import scala .build .options .BuildOptions
15
16
import scala .build .options .ScalaVersionUtil .versions
16
17
import scala .concurrent .duration .DurationInt
@@ -32,15 +33,26 @@ case object ActionableDependencyHandler
32
33
val dependency = setting.value
33
34
val currentVersion = dependency.version
34
35
val latestVersion = value(findLatestVersion(buildOptions, dependency))
35
- if (Version (latestVersion) > Version (currentVersion) && ! isLatestSyntaxVersion(currentVersion))
36
- if (dependency.userParams.contains(" toolkit" ))
36
+ if Version (latestVersion) > Version (currentVersion) && ! isLatestSyntaxVersion(currentVersion)
37
+ then
38
+ if dependency.userParams.contains(Constants .toolkitName) &&
39
+ dependency.module.name != Constants .toolkitTestName
40
+ then
41
+ val toolkitSuggestion =
42
+ if dependency.module.organization == Constants .toolkitOrganization then latestVersion
43
+ else if dependency.module.organization == Constants .typelevelOrganization then
44
+ s " typelevel: $latestVersion"
45
+ else s " ${dependency.module.organization}: $latestVersion"
37
46
Some (ActionableDependencyUpdateDiagnostic (
38
47
setting.positions,
39
48
currentVersion,
40
49
latestVersion,
41
- dependencyModuleName = " toolkit " ,
42
- suggestion = latestVersion
50
+ dependencyModuleName = Constants .toolkitName ,
51
+ suggestion = toolkitSuggestion
43
52
))
53
+ else if dependency.userParams.contains(Constants .toolkitName) &&
54
+ dependency.module.name == Constants .toolkitTestName
55
+ then None // filtering out toolkit-test to prevent double-update-diagnostic
44
56
else
45
57
Some (ActionableDependencyUpdateDiagnostic (
46
58
setting.positions,
0 commit comments