firebase-android-sdk
firebase-android-sdk copied to clipboard
replace sherter plugin with spotless
Opening the project with Android Studio Flamingo (Java 17) shows the following error:
Execution failed for task ':buildSrc:verifyGoogleJavaFormat'.
> Problems: syntax errors
It seems to be due to the fact that the sherter plugin has issues with Java 17: https://github.com/sherter/google-java-format-gradle-plugin/issues/72
Also, sherter is no longer maintained: https://github.com/sherter/google-java-format-gradle-plugin/issues/57#issuecomment-782886280
This PR migrates away from sherter to spotless
List of changes:
- Update the GH Actions workflows to use JDK 17
- Replace the sherter plugin with the spotless plugin - now being used to format both Java (
google-java-format
) and Kotlin (ktfmt
with googleStyle) - Update the README with new formatting instructions
- Run
./gradlew :spotlessApply
to fix formatting
Release note changes
No release note changes were detected. If you made changes that should be
present in the next release, ensure you've added an entry in the appropriate
CHANGELOG.md
file(s).
1 Warning | |
---|---|
:warning: | Did you forget to add a changelog entry? (Add the 'no-changelog' label to the PR to silence this warning.) |
Generated by :no_entry_sign: Danger
buildSrc Test Results
33 tests 33 :heavy_check_mark: 1m 12s :stopwatch: 7 suites 0 :zzz: 7 files 0 :x:
Results for commit e1d93965.
:recycle: This comment has been updated with latest results.
Unit Test Results
0 files - 2 0 suites - 2 0s :stopwatch: -19s 0 tests - 1 0 :heavy_check_mark: - 1 0 :zzz: ±0 0 :x: ±0 0 runs - 2 0 :heavy_check_mark: - 2 0 :zzz: ±0 0 :x: ±0
Results for commit e1d93965. ± Comparison against base commit da631d23.
:recycle: This comment has been updated with latest results.
Size Report 1
Affected Products
No changes between base commit (7375cab) and merge commit (c01d22c).Test Logs
Coverage Report 1
Affected Products
No changes between base commit (da631d2) and merge commit (7c38e0e).Test Logs
Startup Time Report 1
The report is too large (117,075 chars) to be displayed on GitHub. Please check this report on GCS.
Never heard of spotless, looks nice! Seems like spotless also supports kotlin, could it be used across for both languages so we don't need to remember 2 different commands as we do now?
@rlazo Great idea! I'll update the PR
@rlazo I have made the changes but CI is failing with an error from crashlytics-ndk
:
Cannot create variant 'android-aidl' after dependency configuration ':firebase-crashlytics-ndk:debugApiElements' has been resolved
Some solutions online suggest upgrading to the latest AGP. 😅 I feel like that's going to be an even bigger change, I see it's already being done in #4754 How should we proceed here?
Yeah, updating to the latest AGP and gradle is going to take time. That PR you linked was an early exploration, and it's very outdated at this point.
So, as it stands, we would need to upgrade everything together (gradle, agp, and spotless)?
That's what it seems like.
But I noticed that the first commit in this PR (a484b0ec22d87147b80575bf57e30ab0080bf8fe) built successfully (except for some failures from flaky tests), I will try to isolate that commit in a separate PR. Hopefully it will fix the Android Studio build errors for product teams before we upgrade to AGP 8.
we've made several improvements in the code since we last explored this idea. Could you give it another try @thatfiredev ?
Hello, thanks for working on this. This is currently a blocker for external contributions to the Firebase Android SDK because the default JDK of Android Studio is now 17
, so the Gradle sync process fails with the mentioned error.
@svenjacobs Thanks for the nudge, I totally forgot about this PR. Let me try to get it into a mergeable state.
Is this pr not planning to merge yet? This problem has plagued my team