forked from robolectric/robolectric.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update the
Using add-on modules
page (robolectric#296)
- Loading branch information
Showing
1 changed file
with
22 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,27 @@ | ||
--- | ||
hide: | ||
- toc | ||
--- | ||
# Using add-on modules | ||
|
||
# Using Add-On Modules | ||
In order to reduce the number of external dependencies on the application being tested, Robolectric's shadows are split into various add-on packages. Only shadows for classes provided in the base Android SDK are provided by the main Robolectric module. Additional shadows are provided in dedicated packages. | ||
|
||
In order to reduce the number of external dependencies on the application being tested, Robolectric's shadows are split into various add-on packages. Only shadows for classes provided in the base Android SDK are provided by the main Robolectric module. Additional shadows for things like appcompat or the support library are provided by add-on modules. The table below lists the available add-on shadow packages: | ||
> [!NOTE] | ||
> - [Robolectric 3.4](https://github.com/robolectric/robolectric/releases/tag/robolectric-3.4) doesn't include the `shadows-` prefix in the package name (i.e., `org.robolectric:playservices` and `org.robolectric:httpclient`). | ||
> - Before Robolectric 3.4, `org.robolectric:playservices` was named `shadow-play-services`. | ||
| SDK Package | Robolectric Add-On Package | | ||
|--------------------------------------|---------------------------------------| | ||
| com.android.support.support-v4 | org.robolectric:shadows-supportv4 | | ||
| com.android.support.multidex | org.robolectric:shadows-multidex | | ||
| com.google.android.gms:play-services | org.robolectric:shadows-playservices | | ||
| org.apache.httpcomponents:httpclient | org.robolectric:shadows-httpclient | | ||
## Supported packages | ||
|
||
The above artifact names are in use since [Robolectric 3.5](https://github.com/robolectric/robolectric/releases/tag/robolectric-3.5). [Robolectric 3.4](https://github.com/robolectric/robolectric/releases/tag/robolectric-3.4) drops `shadows-` prefix from artifact names. Prior to 3.4, all artifact names are the same as latest, except that `shadows-supportv4` and `shadow-playservices` are `shadows-support-v4` and `shadow-play-services` respectively. | ||
| SDK package | Robolectric add-on package | Javadoc | | ||
|-----|-----|-----| | ||
| `androidx.multidex.MultiDex` | [`org.robolectric:shadows-multidex`](https://github.com/robolectric/robolectric/tree/robolectric-4.13/shadows/multidex) | [Javadoc](javadoc/latest/org/robolectric/shadows/multidex/package-summary.html) | | ||
| `com.android.support.multidex` | [`org.robolectric:shadows-multidex`](https://github.com/robolectric/robolectric/tree/robolectric-4.13/shadows/multidex) | [Javadoc](javadoc/latest/org/robolectric/shadows/multidex/package-summary.html) | | ||
| `com.google.android.gms:play-services` | [`org.robolectric:shadows-playservices`](https://github.com/robolectric/robolectric/tree/robolectric-4.13/shadows/playservices) | [Javadoc](javadoc/latest/org/robolectric/shadows/gms/package-summary.html) | | ||
|
||
Note that `org.robolectric:shadows-supportv4` was deprecated at [Robolectric 4.8](https://github.com/robolectric/robolectric/releases/tag/robolectric-4.8), and was removed at [Robolectric 4.9](https://github.com/robolectric/robolectric/releases/tag/robolectric-4.9). | ||
## Deprecated packages | ||
|
||
| SDK package | Robolectric add-on package | Javadoc | Comment | | ||
|-----|-----|-----|-----| | ||
| `org.apache.httpcomponents:httpclient` | [`org.robolectric:shadows-httpclient`](https://github.com/robolectric/robolectric/tree/robolectric-4.13/shadows/httpclient) | [Javadoc](javadoc/latest/org/robolectric/shadows/httpclient/package-summary.html) | These shadows are only provided for legacy compatibility. | | ||
|
||
## Removed packages | ||
|
||
| SDK package | Robolectric add-on package | Comment | | ||
|-----|-----|-----| | ||
| `com.android.support.support-v4` | `org.robolectric:shadows-supportv4` | This package was deprecated in [Robolectric 4.8](https://github.com/robolectric/robolectric/releases/tag/robolectric-4.8), and removed in [Robolectric 4.9](https://github.com/robolectric/robolectric/releases/tag/robolectric-4.9). | |