简体   繁体   中英

Robolectric Samples and Gradle Plugin

In Robolectric sample project , there is no gradle plugin set up in build.gradle. For instance for AppCompat-v7

On the other hand we have Robolectric gradle plugin which as documentation says:

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.

I wonder why in Robolectric sample project there is no sign of Robolectric Gradle Plugin.

If we can run robolectric tests without the plugin in Android Studio using gradle wrapper, then what is the exact usages of Plugin?

Main reason is that this plugin isn't necessary and will be marked as deprecated if robolectric 3.0 get final. This is a statement from robolectric maintainer erd. See first answer at https://github.com/robolectric/robolectric-gradle-plugin/issues/148

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM