Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion project/SbtPluginSubProjectPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import sbt.ScriptedPlugin.autoImport.scripted
import sbt._
import sbt.plugins.SbtPlugin
import sbtversionpolicy.SbtVersionPolicyMima
import sbtversionpolicy.SbtVersionPolicyPlugin.autoImport.versionPolicyDependencySchemes

// This is all the crazy hacks to get cross compiling working with an sub-project that is an sbt plugin.
object SbtPluginSubProjectPlugin extends AutoPlugin {
Expand All @@ -23,6 +24,7 @@ object SbtPluginSubProjectPlugin extends AutoPlugin {
override def projectSettings: Seq[Def.Setting[_]] =
List(
crossScalaVersions := Nil,
mimaPreviousArtifacts := defaultIfCannotBuild(mimaPreviousArtifacts, Set.empty[ModuleID]).value,
// Remove all project dependencies for Scala 2.13 as they will not resolve when cross building.
projectDependencies := taskDefaultIfSkipped(projectDependencies, Nil).value,
scripted := inputDefaultIfSkipped(scripted, ()).evaluated,
Expand All @@ -32,7 +34,10 @@ object SbtPluginSubProjectPlugin extends AutoPlugin {
// Skip everything else otherwise it will just fail.
skip := !spspCanBuild.value,
undeclaredCompileDependenciesFilter -= moduleFilter(),
mimaPreviousArtifacts := defaultIfCannotBuild(mimaPreviousArtifacts, Set.empty[ModuleID]).value
// These transitive dependencies that have been "vendored" by sbt appear as though they are
// pre-release as they contain build metadata.
// Trust that sbt correctly manages its own version policy in accordance with its dependencies.
versionPolicyDependencySchemes += "org.scala-sbt.jline" % "*" % "always"
)

def defaultIfCannotBuild[A](setting: Def.Initialize[A], default: => A): Def.Initialize[A] =
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version = 1.4.8
sbt.version = 1.4.9