From b2bac40e6f8412d614a861b86a429ce9b5d38fff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Muller?= Date: Fri, 30 Aug 2024 06:58:40 +0200 Subject: [PATCH] Add links to Robolectric releases (#294) This PR adds a link to the right release whenever there is a reference to a specific version. --- docs/androidx_test.md | 2 +- docs/configuring.md | 8 ++++---- docs/device-configuration.md | 2 +- docs/extending.md | 4 ++-- docs/using-add-on-modules.md | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/androidx_test.md b/docs/androidx_test.md index 81a765c1d..4fc9ab339 100644 --- a/docs/androidx_test.md +++ b/docs/androidx_test.md @@ -1,6 +1,6 @@ # AndroidX Test -Robolectric is intended to be fully compatible with Android's official testing libraries since version 4.0. +Robolectric is intended to be fully compatible with Android's official testing libraries since [version 4.0](https://github.com/robolectric/robolectric/releases/tag/robolectric-4.0). As such, we encourage you to try these new APIs and provide feedback. At some point, the Robolectric equivalents will be deprecated and removed. Using the AndroidX Test APIs reduces the cognitive load for you as a developer, with just one set of APIs to learn for the same Android concept, no matter if you are writing an Robolectric test or an instrumentation diff --git a/docs/configuring.md b/docs/configuring.md index be7e86a5f..366a91fea 100644 --- a/docs/configuring.md +++ b/docs/configuring.md @@ -44,7 +44,7 @@ shadows=com.mycompany.ShadowFoo,com.mycompany.ShadowBar ``` > [!NOTE] -> Prior to Robolectric 3.1.3, only a top-level `robolectric.properties` file may be specified. +> Prior to [Robolectric 3.1.3](https://github.com/robolectric/robolectric/releases/tag/robolectric-3.1.3), only a top-level `robolectric.properties` file may be specified. ### Global Configuration @@ -111,7 +111,7 @@ Note that `sdk` and `minSdk`/`maxSdk` may not be specified in the same `@Config` however, `minSdk` and `maxSdk` may be specified together. If any of them is present, they override any SDK specification from a less-specific configuration location. > [!NOTE] -> Prior to Robolectric 3.2, `minSdk` and `maxSdk` are ignored, and [`NEWEST_SDK`](javadoc/latest/org/robolectric/annotation/Config.html#NEWEST_SDK), [`OLDEST_SDK`](javadoc/latest/org/robolectric/annotation/Config.html#OLDEST_SDK), and [`TARGET_SDK`](javadoc/latest/org/robolectric/annotation/Config.html#TARGET_SDK) are not supported. +> Prior to [Robolectric 3.2](https://github.com/robolectric/robolectric/releases/tag/robolectric-3.2), `minSdk` and `maxSdk` are ignored, and [`NEWEST_SDK`](javadoc/latest/org/robolectric/annotation/Config.html#NEWEST_SDK), [`OLDEST_SDK`](javadoc/latest/org/robolectric/annotation/Config.html#OLDEST_SDK), and [`TARGET_SDK`](javadoc/latest/org/robolectric/annotation/Config.html#TARGET_SDK) are not supported. > Also, only integers corresponding to API levels may be specified in a properties file. ### Configure `Application` class @@ -189,7 +189,7 @@ Some additional options can be configured globally by setting these system prope | `robolectric.dependency.repo.password` | Password of the repository that you defined in `robolectric.dependency.repo.url`. | `null` | | `robolectric.logging.enabled` | Set to `true` to enable debug logging. | `false` | -Since Robolectric **4.9.1**, you can now add these parameters : +Since [Robolectric 4.9.1](https://github.com/robolectric/robolectric/releases/tag/robolectric-4.9.1), you can now add these parameters : | Property name | Description | Default value | |-----|-----|-----| @@ -243,7 +243,7 @@ For example, to override the Maven repository URL and ID to download the runtime ## `ConscryptMode` -Starting with Robolectric 4.9, Robolectric can either use Conscrypt and BouncyCastle or just BouncyCastle as the security provider. +Starting with [Robolectric 4.9](https://github.com/robolectric/robolectric/releases/tag/robolectric-4.9), Robolectric can either use Conscrypt and BouncyCastle or just BouncyCastle as the security provider. In order to migrate tests over time, there is a [`ConscryptMode`](javadoc/latest/org/robolectric/annotation/ConscryptMode.html) annotation that controls whether Conscrypt is loaded as the default security provider with BouncyCastle as backup. - If `ConscryptMode` is `ON`, it will install Conscrypt and BouncyCastle. diff --git a/docs/device-configuration.md b/docs/device-configuration.md index 0a9d833a5..7ee58529a 100644 --- a/docs/device-configuration.md +++ b/docs/device-configuration.md @@ -24,7 +24,7 @@ The Android device configuration can be specified using the [`qualifiers`](javad } ``` -From version 3.6 on, Robolectric parses the `qualifiers` property according to the rules set forth [here](https://developer.android.com/guide/topics/resources/providing-resources.html#QualifierRules) (but with no preceding directory name), and sets up the Android simulation environment with a corresponding configuration. The system's `Configuration`, [`Display`](https://developer.android.com/reference/android/view/Display) and [`DisplayMetrics`](https://developer.android.com/reference/android/hardware/display/DisplayManager) objects will all reflect the specified configuration, the locale will be set, and appropriate resources will be selected. +From [version 3.6](https://github.com/robolectric/robolectric/releases/tag/robolectric-3.6) on, Robolectric parses the `qualifiers` property according to the rules set forth [here](https://developer.android.com/guide/topics/resources/providing-resources.html#QualifierRules) (but with no preceding directory name), and sets up the Android simulation environment with a corresponding configuration. The system's `Configuration`, [`Display`](https://developer.android.com/reference/android/view/Display) and [`DisplayMetrics`](https://developer.android.com/reference/android/hardware/display/DisplayManager) objects will all reflect the specified configuration, the locale will be set, and appropriate resources will be selected. For unspecified properties, Robolectric picks consistent values based on the properties that have been specified, or uses default values as follows: diff --git a/docs/extending.md b/docs/extending.md index ebdf94487..7b5791caa 100644 --- a/docs/extending.md +++ b/docs/extending.md @@ -190,10 +190,10 @@ dependencies { ## Best practices ### Limit API surface area of shadows. -Since Robolectric 3.7 `@Implementation` methods including `__constructor__` methods can be made `protected`. This is desirable as test code has no business calling these methods, by making your `@Implementation` methods protected you encourage test writers to call the public Android APIs instead. +Since [Robolectric 3.7](https://github.com/robolectric/robolectric/releases/tag/robolectric-3.7) `@Implementation` methods including `__constructor__` methods can be made `protected`. This is desirable as test code has no business calling these methods, by making your `@Implementation` methods protected you encourage test writers to call the public Android APIs instead. ### Don't use `useinheritImplementationMethods` -This is usually unnecessary and will be removed in Robolectric 3.8 +This is usually unnecessary and will be removed in [Robolectric 3.8](https://github.com/robolectric/robolectric/releases/tag/robolectric-3.8) ### Don't override `equals`, `hashCode` and `toString` in shadows. Avoid this unless you are mimicking behaviour in the class being shadowed. To test equality for comparisons in tests prefer helpers or assertion library extensions. prefer adding a `describe()` method instead of shadowing `toString()` diff --git a/docs/using-add-on-modules.md b/docs/using-add-on-modules.md index d2ca4c233..c84cded2c 100644 --- a/docs/using-add-on-modules.md +++ b/docs/using-add-on-modules.md @@ -14,6 +14,6 @@ In order to reduce the number of external dependencies on the application being | com.google.android.gms:play-services | org.robolectric:shadows-playservices | | org.apache.httpcomponents:httpclient | org.robolectric:shadows-httpclient | -The above artifact names are in use since Robolectric 3.5+. Robolectric 3.4.x 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. +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. -Note that `org.robolectric:shadows-supportv4` was deprecated at Robolectric 4.8, and was removed at Robolectric 4.9. +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).