-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support test scope by ignoring repeated pipelining flags
- Loading branch information
1 parent
baa1c56
commit ce866d1
Showing
7 changed files
with
67 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
sbt-test/pipelining/pipelining-test/a/src/main/scala/a/A.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package a | ||
|
||
object A { | ||
val foo: (1,2,3) = (1,2,3) | ||
} |
12 changes: 12 additions & 0 deletions
12
sbt-test/pipelining/pipelining-test/a/src/test/scala/a/Hello.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package a | ||
|
||
import a.A | ||
|
||
import org.junit.Test | ||
|
||
class Hello { | ||
|
||
@Test def test(): Unit = { | ||
assert(A.foo == (1,2,3)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
ThisBuild / usePipelining := true | ||
|
||
lazy val a = project.in(file("a")) | ||
.settings( | ||
scalacOptions += "-Ycheck:all", | ||
libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % "test", | ||
) |
12 changes: 12 additions & 0 deletions
12
sbt-test/pipelining/pipelining-test/project/DottyInjectedPlugin.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import sbt._ | ||
import Keys._ | ||
|
||
object DottyInjectedPlugin extends AutoPlugin { | ||
override def requires = plugins.JvmPlugin | ||
override def trigger = allRequirements | ||
|
||
override val projectSettings = Seq( | ||
scalaVersion := sys.props("plugin.scalaVersion"), | ||
scalacOptions += "-source:3.0-migration" | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# run the tests on a project with pipelining | ||
# exercises the fact that -Ypickle-java and -Ypickle-write | ||
# flags are set twice. | ||
# steps: | ||
# - Compile scope is compiled with flags `-Ypickle-java -Ypickle-write early/a-early-7423784.jar` | ||
# - sbt copies `early/a-early-7423784.jar` to `early/a-early.jar` | ||
# - Test scope is compiled with flags `-Ypickle-java -Ypickle-write early-test/a-early-963232.jar -Ypickle-java -Ypickle-write early/a-early.jar -classpath early/a-early.jar` | ||
# e.g. for some reason the classpath has the same `a-early.jar` that | ||
# is passed with `Ypickle-write`. | ||
# Therefore we MUST avoid even reading the second `-Ypickle-write` setting, | ||
# otherwise we will zero-out `a-early.jar`, causing type errors because its contents are blank. | ||
> a/test |