-
Notifications
You must be signed in to change notification settings - Fork 931
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow using a projectref across scala versions with cross building #5511
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -158,8 +158,8 @@ object Cross { | |
|
||
// Execute using a blanket switch | ||
projCrossVersions.toMap.apply(extracted.currentRef).flatMap { version => | ||
// Force scala version | ||
Seq(s"$SwitchCommand $verbose $version!", aggCommand) | ||
// Set scala version | ||
Seq(s"$SwitchCommand $verbose $version", aggCommand) | ||
} | ||
case Right((keys, taskArgs)) => | ||
def project(key: ScopedKey[_]): Option[ProjectRef] = key.scope.project.toOption match { | ||
|
@@ -195,11 +195,11 @@ object Cross { | |
commandsByVersion.flatMap { | ||
case (v, commands) => | ||
commands match { | ||
case Seq(c) => Seq(s"$SwitchCommand $verbose $v! $c") | ||
case Seq(c) => Seq(s"$SwitchCommand $verbose $v $c") | ||
case Seq() => Nil // should be unreachable | ||
case multi if fullArgs.isEmpty => | ||
Seq(s"$SwitchCommand $verbose $v! all ${multi.mkString(" ")}") | ||
case multi => Seq(s"$SwitchCommand $verbose $v!") ++ multi | ||
case multi => Seq(s"$SwitchCommand $verbose $v") ++ multi | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, in #5494 I didn't really know what I was doing and I aggressively removed the use of After I sent #5494 I started thinking I might introduce other regressions. PS: I noticed you didn't edit line There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The reproducer doesn't need all 3 changes, but it would be quite inconsistent to not change all of these occurrences, as they seems quite similar. I'm definitely not familiar enough with this code to predict all the possible effects of this change, but at least the test suite doesn't appear to signal any regressions. |
||
} | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
val b = Project("b", file("b")) | ||
.settings( | ||
crossScalaVersions := Seq("2.12.10", "2.13.1"), | ||
compile in Compile := { | ||
// We'd like to be able to inspect to this 2.12-only project | ||
// even while compiling the 2.13 version of 'b' | ||
(fullClasspath in Compile in ProjectRef(file("."), "c")).value | ||
(compile in Compile).value | ||
} | ||
) | ||
|
||
val c = Project("c", file("c")) | ||
.enablePlugins(SbtPlugin) | ||
.settings( | ||
crossScalaVersions := Seq("2.12.10"), | ||
libraryDependencies += | ||
// Some library that is not available on 2.13 | ||
"com.typesafe.akka" %% "akka-actor" % "2.5.0" | ||
) | ||
|
||
val root = Project("reproduce-5497", file(".")) | ||
.aggregate(b, c) | ||
.settings( | ||
crossScalaVersions := Nil | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
> +compile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this ! is necessary for sbt 0.13 emulation - #5497 (comment)