Fix build for Gradle >8.5 and modern build tools#226
Open
Groxx wants to merge 3 commits intoandroid-rcs:masterfrom
Open
Fix build for Gradle >8.5 and modern build tools#226Groxx wants to merge 3 commits intoandroid-rcs:masterfrom
Groxx wants to merge 3 commits intoandroid-rcs:masterfrom
Conversation
added 3 commits
November 7, 2025 00:01
…d in switches by AS-replacing them with if statements.
With the exception of:
```
public boolean onOptionsItemSelected(MenuItem item) {
```
in RI/src/com/gsma/rcs/ri/messaging/TalkList.java, all switch refactors were done automatically via Android Studio's "rewrite switch statement as ifs".
A cursory glance looks correct and I generally trust non-ai refactors so I think that's sufficient, but I have not actually checked them carefully.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A few changes rolled into one to get this project into a "you can open it in the current Android Studio and it can build and run tests" state.
I have NOT been doing Android work consistently over the past 10 years that this project has existed though, so I'm not 100% confident about this PR.
It works for me and I've tried to make reasonably sure everything is correct, but major build-system upgrades like this tend to have a lot of subtle surprises that are hard to learn about years afterward :\
So I, personally, would be happy enough using this - it seems functional enough and nobody should be depending on this project in any sensitive way. But obviously the final decision is yours, and I have no solid evidence that it's actually correct :)
seems-definitely-required changes:
compile->implementsdependency-type rename<<->doLast, as<<is fully removed nowAndroidManifest.xmlnamespace into the relevantbuild.gradlefiles, and updated themanifest.srcFilebecause apparently the default location has moved and it wasn't finding mostlibs/api/...(the only sub-project that needs it)AndroidManifest.xmlnamespace, as the build tools said that wasn't allowed. unfortunately I'm not sure if this has any consequences, but even if it does it seems almost certainly limited to test-related activities? like at worst it might replace the non-test app rather than installing along-side it.switch(...) { case R.id.xyz->if (... == R.id.xyz)automated rewrite via Android Studio's refactor toolR.id.xyzis no longer a build-time constant, so it cannot be used in a switch statement. There might be a way to change the build to restore this, but my brief attempts didn't work, and it didn't seem worth spending more effort on when I have an automated rewriter.onOptionsItemSelectedinRI/src/com/gsma/rcs/ri/messaging/TalkList.javamanifest.srcFilewhen needed inbuild.gradlefiles, as the default location has movedother minor non-functional changes that I happened to see:
R.idswitch rewrites.\tcharacters inbuild.gradlefiles changed to four spaces, and whitespace trailers removed, to be consistent.assertEqualsargs on a test I happened to look at were backwards, so I swapped them (should beexpected, actual).A somewhat annoyingly large set of changes for review purposes (sorry!), but I've tried to keep it fairly reasonable and limited in focus.
I'm still trying to find any other problems I may have missed, but I can run the
testUnitDebugTestgradle target successfully now, except for emulator-run tests that require a telephony stack (other in-emulator tests succeed).