@@ -7,6 +7,7 @@ import sbt.ScriptedPlugin.autoImport.scripted
7
7
import sbt ._
8
8
import sbt .plugins .SbtPlugin
9
9
import sbtversionpolicy .SbtVersionPolicyMima
10
+ import sbtversionpolicy .SbtVersionPolicyPlugin .autoImport .versionPolicyDependencySchemes
10
11
11
12
// This is all the crazy hacks to get cross compiling working with an sub-project that is an sbt plugin.
12
13
object SbtPluginSubProjectPlugin extends AutoPlugin {
@@ -23,6 +24,7 @@ object SbtPluginSubProjectPlugin extends AutoPlugin {
23
24
override def projectSettings : Seq [Def .Setting [_]] =
24
25
List (
25
26
crossScalaVersions := Nil ,
27
+ mimaPreviousArtifacts := defaultIfCannotBuild(mimaPreviousArtifacts, Set .empty[ModuleID ]).value,
26
28
// Remove all project dependencies for Scala 2.13 as they will not resolve when cross building.
27
29
projectDependencies := taskDefaultIfSkipped(projectDependencies, Nil ).value,
28
30
scripted := inputDefaultIfSkipped(scripted, ()).evaluated,
@@ -32,7 +34,10 @@ object SbtPluginSubProjectPlugin extends AutoPlugin {
32
34
// Skip everything else otherwise it will just fail.
33
35
skip := ! spspCanBuild.value,
34
36
undeclaredCompileDependenciesFilter -= moduleFilter(),
35
- mimaPreviousArtifacts := defaultIfCannotBuild(mimaPreviousArtifacts, Set .empty[ModuleID ]).value
37
+ // These transitive dependencies that have been "vendored" by sbt appear as though they are
38
+ // pre-release as they contain build metadata.
39
+ // Trust that sbt correctly manages its own version policy in accordance with its dependencies.
40
+ versionPolicyDependencySchemes += " org.scala-sbt.jline" % " *" % " always"
36
41
)
37
42
38
43
def defaultIfCannotBuild [A ](setting : Def .Initialize [A ], default : => A ): Def .Initialize [A ] =
0 commit comments