Android Jack mockito 替代品

也许现在问这个问题还为时过早,但正如今天宣布杰克和吉尔一样,我对此感到非常兴奋.我真的很想去,但他们也说:

Maybe is too soon to ask, but as Jack and Jill was announced today I get very excited with it. I really want to go for it, but they also state:

读取 .class 文件的各种工具(例如 JaCoCo、Mockito 和一些 lint 检查)目前与 Jack 编译器不兼容.

jack 编译器已经有一个 mockito 替代品了?

There is already an mockito alternative for jack compiler ?

推荐答案

Mockito 在编译时不会生成任何字节码,因此不受所使用的编译器的影响.dexmaker 也是如此.(他们在构建过程中没有任何挂钩到 Gradle)

Mockito doesn't generate any byte code at compile time and hence is not affected by the used compiler. Same holds true for dexmaker. (they don't have any hooks into Gradle during build)

因此,即使使用 Jack 编译器,您也可以继续使用 Mockito.请注意,我有一个 测试项目 可以证实这一点.

So you can simply continue to use Mockito, even with Jack compiler. Note that I have a test project which confirms this.

相关文章