問題描述
也許現在問這個問題還為時過早,但正如今天宣布杰克和吉爾一樣,我對此感到非常興奮.我真的很想去,但他們也說:
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.
這篇關于Android Jack mockito 替代品的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!