Robolectric 示例和 Gradle 插件
Robolectric Samples and Gradle Plugin
在Robolectric sample project, there is no gradle plugin set up in build.gradle. For instance for AppCompat-v7
另一方面,我们有 Robolectric gradle plugin,如文档所述:
A Gradle plugin which enables Robolectric tests.
This plugin piggy-backs on the unit testing support added in version
1.1.0 of the Android Gradle plugin and configures the test tasks to work correctly with Robolectric.
我想知道为什么在Robolectric sample project中没有Robolectric Gradle插件的迹象。
如果我们可以 运行 robolectric 在 Android Studio 中使用 gradle 包装器在没有插件的情况下进行测试,那么插件的确切用法是什么?
主要原因是这个插件不是必需的,如果 robolectric 3.0 最终版,它将被标记为已弃用。这是来自 robolectric 维护者 erd 的声明。在 https://github.com/robolectric/robolectric-gradle-plugin/issues/148
查看第一个答案
在Robolectric sample project, there is no gradle plugin set up in build.gradle. For instance for AppCompat-v7
另一方面,我们有 Robolectric gradle plugin,如文档所述:
A Gradle plugin which enables Robolectric tests.
This plugin piggy-backs on the unit testing support added in version 1.1.0 of the Android Gradle plugin and configures the test tasks to work correctly with Robolectric.
我想知道为什么在Robolectric sample project中没有Robolectric Gradle插件的迹象。
如果我们可以 运行 robolectric 在 Android Studio 中使用 gradle 包装器在没有插件的情况下进行测试,那么插件的确切用法是什么?
主要原因是这个插件不是必需的,如果 robolectric 3.0 最终版,它将被标记为已弃用。这是来自 robolectric 维护者 erd 的声明。在 https://github.com/robolectric/robolectric-gradle-plugin/issues/148
查看第一个答案