Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the "Automated Migration" page #313

Merged
merged 1 commit into from
Sep 22, 2024

Conversation

MGaetan89
Copy link
Member

This PR updates the Automated Migration page.

The changes are:

  • Adding Kotlin code sample.
  • Update the procedure to match recent versions of Error Prone.

This PR updates the [Automated Migration](https://robolectric.org/automated-migration/) page.

The changes are:
- Adding Kotlin code sample.
- Update the procedure to match recent versions of Error Prone.
apply plugin: "net.ltgt.errorprone"

dependencies {
errorprone "com.google.errorprone:error_prone_core:2.3.2"
errorproneJavac "com.google.errorprone:javac:9+181-r4173-1"
Copy link
Member Author

@MGaetan89 MGaetan89 Sep 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I could see, this dependency is added automatically by the Gradle plugin, for specific Java versions:
https://github.com/tbroyer/gradle-errorprone-plugin/blob/e22bbca556aca14bc10e34324675877c67ad5f0e/src/main/kotlin/net/ltgt/gradle/errorprone/ErrorPronePlugin.kt#L103-L111


```bash
ROBOLECTRIC_MIGRATION=DeprecatedMethods ./gradlew clean :compileDebugUnitTestJava
ROBOLECTRIC_MIGRATION=ShadowUsageCheck ./gradlew clean :compileDebugUnitTestJava
ROBOLECTRIC_MIGRATION=DeprecatedMethods,ShadowUsageCheck ./gradlew clean :compileDebugUnitTestJava
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that it is now possible to pass multiple checks at once. See https://errorprone.info/docs/patching
Screenshot 2024-09-22 at 11 46 12

@utzcoz
Copy link
Member

utzcoz commented Sep 22, 2024

Looks like no-one has tried this errorprone tool for migration recent years.

@MGaetan89 MGaetan89 merged commit 57b6783 into robolectric:master Sep 22, 2024
1 check passed
@MGaetan89 MGaetan89 deleted the update_automated_migration branch September 22, 2024 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants