Skip to content

Commit

Permalink
Extract links from blog posts (robolectric#331)
Browse files Browse the repository at this point in the history
  • Loading branch information
MGaetan89 authored Oct 16, 2024
1 parent b9ef63d commit 2b0dbc7
Show file tree
Hide file tree
Showing 11 changed files with 205 additions and 111 deletions.
5 changes: 4 additions & 1 deletion docs/blog/posts/2017-03-01-hermetic-builds.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ slug: hermetic-builds

Robolectric needs access to multiple Android SDK jars in order to perform its magic, which means it needs special configuration beyond just setting up dependencies in your build. By default, it tries to download Android SDK jars from Maven Central.

But what if you have a [hermetic build environment](https://blog.fahhem.com/2013/12/hermetic-build-systems/)? You just need to do a little more configuration.
But what if you have a [hermetic build environment][hermetic-build]? You just need to do a little
more configuration.

Here's a Gradle build script that'll help:

Expand Down Expand Up @@ -140,3 +141,5 @@ Add the `.jar` files listed in `build/output/README.txt` as compile-time depende
Place the file called `build/output/robolectric-deps.properties` in your test `resources` directory. Change the paths as indicated in the comment in that file.

You're all set! Robolectric will now load Android SDKs from the filesystem instead of attempting to download them from Maven Central.

[hermetic-build]: https://blog.fahhem.com/2013/12/hermetic-build-systems
18 changes: 12 additions & 6 deletions docs/blog/posts/2017-03-02-robolectric-3-3-and-roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@ slug: robolectric-3-3-and-roadmap

# Robolectric 3.3 and Roadmap

Your Robolectric maintainers are pleased to announce the release of [Robolectric 3.3](https://github.com/robolectric/robolectric/releases/tag/robolectric-3.3)! There's been a bunch of activity recently in Robolectric, and we wanted to give a quick update on our thinking about where the project is going.
Your Robolectric maintainers are pleased to announce the release of
[Robolectric 3.3][robolectric-3.3-release]! There's been a bunch of activity recently in
Robolectric, and we wanted to give a quick update on our thinking about where the project is going.

## Introduction

Robolectric started life in 2010 as a quick hack to allow Android tests to be run on a regular JVM rather than a device or emulator, allowing for fast [TDD cycles](https://en.wikipedia.org/wiki/Test-driven_development#Coding_cycle). It was mostly developed in brief spurts as needed for testing specific projects.
Robolectric started life in 2010 as a quick hack to allow Android tests to be run on a regular JVM
rather than a device or emulator, allowing for fast [TDD cycles][tdd-cycles]. It was mostly
developed in brief spurts as needed for testing specific projects.

Since then, it's been cool to see Robolectric grow with the help of the community, and become quite widely used. It's become a critical part of the test infrastructure of lots of companies and projects. It's rather outgrown the scrappy side-project Robolectric was for much of its life and needs some full-time attention.

Expand Down Expand Up @@ -44,10 +48,12 @@ As new SDKs and new features are released, we'll make sure Robolectric supports

## Community

We're going to do our best to stay on top of bug reports and pull requests. We'll be continuing to develop in the open on [GitHub](https://github.com/robolectric/robolectric), and we'd love your input on changes and designs.
We're going to do our best to stay on top of bug reports and pull requests. We'll be continuing to
develop in the open on [GitHub][robolectric-github], and we'd love your input on changes and
designs.

As always, thanks for your pull requests, bug reports, ideas and questions!

_Your Robolectric maintainers,_
<br/>
[[email protected]](mailto:[email protected]) and [[email protected]](mailto:[email protected])
[robolectric-3.3-release]: https://github.com/robolectric/robolectric/releases/tag/robolectric-3.3
[robolectric-github]: https://github.com/robolectric/robolectric
[tdd-cycles]: https://en.wikipedia.org/wiki/Test-driven_development#Coding_cycle
7 changes: 3 additions & 4 deletions docs/blog/posts/2017-11-13-resources-for-real.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ We're doing this in three separate releases to give you a chance to fix your tes

The releases will be:

- **3.6:** Resource selection based on transliterated framework code. Configuration properties set from [`@Config(qualifiers)`](../../device-configuration.md).
- **3.6:** Resource selection based on transliterated framework code. Configuration properties set
from [`@Config(qualifiers)`][config-annotation].
- **3.7:** Manifest parsing based on transliterated framework code.
- **3.8:** Resource loading from `aapt`-processed binary resource files.

Expand All @@ -29,6 +30,4 @@ Going forward, we're applying a higher standard for accuracy in Robolectric's im

As always, thanks for your pull requests, bug reports, ideas and questions! &#x1f4af;

_Your Robolectric maintainers,_
<br/>
[[email protected]](mailto:[email protected]), [[email protected]](mailto:[email protected]), and [[email protected]](mailto:[email protected]).
[config-annotation]: ../../device-configuration.md
24 changes: 18 additions & 6 deletions docs/blog/posts/2018-05-09-robolectric-4-0-alpha.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ The Robolectric team is super excited to announce the first alpha release of Rob

## `androidx.test`

We’re collaborating closely with the Android Jetpack testing team to develop common APIs for writing Android tests that can run as both local (JVM-based) and on-device (instrumentation) tests. From 4.0 on, Robolectric will support Jetpack’s [`androidx.test`](https://developer.android.com/training/testing/) APIs, starting with support for the [`AndroidJUnit4` test runner](https://developer.android.com/training/testing/junit-runner), [`ActivityTestRule`](https://developer.android.com/training/testing/junit-rules), and [Espresso](https://developer.android.com/training/testing/espresso/) for interacting with UI components.
We’re collaborating closely with the Android Jetpack testing team to develop common APIs for writing
Android tests that can run as both local (JVM-based) and on-device (instrumentation) tests. From 4.0
on, Robolectric will support Jetpack’s [`androidx.test`][androidx-test] APIs, starting with support
for the [`AndroidJUnit4` test runner][junit-runner], [`ActivityTestRule`][activity-test-rule],
and [Espresso][espresso] for interacting with UI components.

### A Robolectric 3.x style test

Expand Down Expand Up @@ -49,20 +53,28 @@ As you can see, many of the idioms common in instrumentation tests are now suppo

In conjunction with Android Studio 3.2, Robolectric can now use resources processed using the Android build toolchain, and loads and handles those resources using the same logic as on an actual Android device. Robolectric's old idiosyncratic resource handling mode is still available for projects not yet using the latest version of the build toolchain.

To enable the use of toolchain-processed resources in Robolectric tests, make sure you're using [Android Gradle Plugin](https://developer.android.com/studio/releases/gradle-plugin#updating-plugin) version `com.android.tools.build:gradle:3.2.0-alpha14` or higher, and add the following to your `gradle.properties`:
To enable the use of toolchain-processed resources in Robolectric tests, make sure you're
using [Android Gradle Plugin][android-gradle-plugin] version
`com.android.tools.build:gradle:3.2.0-alpha14` or higher, and add the following to your
`gradle.properties`:

```properties
android.enableUnitTestBinaryResources=true
```

## Release Notes

Release notes are [available here](https://github.com/robolectric/robolectric/releases/tag/robolectric-4.0-alpha-1). Robolectric 4.0 is currently in alpha release, meaning that it is not yet feature-complete, and APIs are likely to change before the final release. Use with caution.
Release notes are [available here][robolectric-4.0-alpha-1-release]. Robolectric 4.0 is currently in
alpha release, meaning that it is not yet feature-complete, and APIs are likely to change before the
final release. Use with caution.

---

As always, thanks for your pull requests, bug reports, ideas and questions! &#x1f4af;

_Your Robolectric maintainers,_
<br/>
[[email protected]](mailto:[email protected]), [[email protected]](mailto:[email protected]), and [[email protected]](mailto:[email protected]).
[activity-test-rule]: https://developer.android.com/training/testing/junit-rules
[android-gradle-plugin]: https://developer.android.com/studio/releases/gradle-plugin#updating-plugin
[androidx-test]: https://developer.android.com/training/testing
[espresso]: https://developer.android.com/training/testing/espresso
[junit-runner]: https://developer.android.com/training/testing/junit-runner
[robolectric-4.0-alpha-1-release]: https://github.com/robolectric/robolectric/releases/tag/robolectric-4.0-alpha-1
28 changes: 21 additions & 7 deletions docs/blog/posts/2018-10-25-robolectric-4-0.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ Robolectric 4.0 is released! Here's what's new!

## `androidx.test`

The different idioms for testing using Robolectric and instrumentation tests have long been a headache. With today's release of Robolectric 4.0 and [`androidx.test`](https://developer.android.com/training/testing/) 1.0.0, both testing environments are converging on a set of common test APIs. Robolectric now supports the [`AndroidJUnit4` test runner](https://developer.android.com/training/testing/junit-runner), [`ActivityTestRule`](https://developer.android.com/training/testing/junit-rules), and [Espresso](https://developer.android.com/training/testing/espresso/) for interacting with UI components.
The different idioms for testing using Robolectric and instrumentation tests have long been a
headache. With today's release of Robolectric 4.0 and [`androidx.test`][androidx-test] 1.0.0, both
testing environments are converging on a set of common test APIs. Robolectric now supports the
[`AndroidJUnit4` test runner][junit-runner], [`ActivityTestRule`][activity-test-rule], and
[Espresso][espresso] for interacting with UI components.

### A Robolectric 3.x style test

Expand Down Expand Up @@ -49,7 +53,9 @@ As you can see, many of the idioms common in instrumentation tests are now suppo

In conjunction with Android Studio 3.2, Robolectric can now use resources processed using the Android build toolchain, and loads and handles those resources using the same logic as on an actual Android device. Robolectric's old idiosyncratic resource handling mode is still available for projects not yet using the latest version of the build toolchain, but is now deprecated and will be removed in a future release.

To enable the use of toolchain-processed resources in Robolectric tests, make sure you're using [Android Gradle Plugin](https://developer.android.com/studio/releases/gradle-plugin#updating-plugin) version `com.android.tools.build:gradle:3.2.1` or higher, and add the following to your `gradle.properties`:
To enable the use of toolchain-processed resources in Robolectric tests, make sure you're using
[Android Gradle Plugin][android-gradle-plugin] version `com.android.tools.build:gradle:3.2.1` or
higher, and add the following to your `gradle.properties`:

```groovy
android {
Expand All @@ -73,16 +79,24 @@ android.enableUnitTestBinaryResources=true

## Migration Tool

Robolectric 4.0 contains a number of API changes that may require modifications to your test code. Check out the [migration notes](../../migrating.md#migrating-to-40) and use the new [automated migration tool](../../automated-migration.md) to help convert your existing tests to be compatible with Robolectric 4.0.
Robolectric 4.0 contains a number of API changes that may require modifications to your test code.
Check out the [migration notes][migration] and use the new
[automated migration tool][automated-migration-tool] to help convert your existing tests to be
compatible with Robolectric 4.0.

## Release Notes

Release notes are [available here](https://github.com/robolectric/robolectric/releases/tag/robolectric-4.0).
Release notes are [available here][robolectric-4.0-release].

---

As always, thanks for your pull requests, bug reports, ideas and questions! &#x1f4af;

_Your Robolectric maintainers,_
<br/>
[[email protected]](mailto:[email protected]), [[email protected]](mailto:[email protected]), and [[email protected]](mailto:[email protected]).
[activity-test-rule]: https://developer.android.com/training/testing/junit-rules
[android-gradle-plugin]: https://developer.android.com/studio/releases/gradle-plugin#updating-plugin
[androidx-test]: https://developer.android.com/training/testing
[automated-migration-tool]: ../../automated-migration.md
[espresso]: https://developer.android.com/training/testing/espresso
[junit-runner]: https://developer.android.com/training/testing/junit-runner
[migration]: ../../migrating.md#migrating-to-40
[robolectric-4.0-release]: https://github.com/robolectric/robolectric/releases/tag/robolectric-4.0
Loading

0 comments on commit 2b0dbc7

Please sign in to comment.