mirror of https://github.com/sbt/sbt.git
Add a pending test-case for showing circular api structures.
This test should pass because `ShowAPI` skips inherited members but due to sbt/sbt#676 it fails with StackOverflowError. This makes it a decent test-case for both showing circular api structures and for the aforementioned bug itself.
This commit is contained in:
parent
f885458f37
commit
289d031466
|
|
@ -0,0 +1,12 @@
|
|||
logLevel := Level.Debug
|
||||
|
||||
incOptions ~= { _.copy(apiDebug = true) }
|
||||
|
||||
TaskKey[Unit]("show-apis") <<= (compile in Compile, scalaSource in Compile, javaSource in Compile) map { (a: sbt.inc.Analysis, scalaSrc: java.io.File, javaSrc: java.io.File) =>
|
||||
val aApi = a.apis.internalAPI(scalaSrc / "A.scala").api
|
||||
val jApi = a.apis.internalAPI(javaSrc / "test/J.java").api
|
||||
import xsbt.api.DefaultShowAPI
|
||||
import DefaultShowAPI._
|
||||
DefaultShowAPI.showSource.show(aApi)
|
||||
DefaultShowAPI.showSource.show(jApi)
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# test case for http://github.com/sbt/sbt/issues/676
|
||||
> compile
|
||||
# fails with StackOverflowException
|
||||
> show-apis
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
package test;
|
||||
|
||||
public class J {
|
||||
public static final class J2 extends J { }
|
||||
public static final class J3 extends J { }
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
package test
|
||||
|
||||
class A {
|
||||
class B extends A
|
||||
class C extends A
|
||||
}
|
||||
Loading…
Reference in New Issue