Skip to content

[Android] remove obsolete gradle api in FGP #172085

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

Merged
merged 3 commits into from
Jul 15, 2025

Conversation

Sameri11
Copy link
Contributor

@Sameri11 Sameri11 commented Jul 13, 2025

fixes #170791

This PR replaces the deprecated (and removed in 9.0) Gradle fileMode API in favor of filePermissions.
This change finally unlocks builds with gradle 9 (confirmed in smoke tests, 9.0.0-rc.2 is the latest prerelease version to the date).

Testing strategy

There's an attempt to add a Kotlin unit test that confirms that filePermissions were called during plugin application. I failed to find a more precise way to check if the new code works as intended (such as testing that permissions were really changed or something like that), but on the other hand, it should not be required since it will transform the test in a way that it will start to test Gradle APIs and their behavior, and I believe it's a bit out of scope: Gradle APIs are tested in Gradle tests :)

Anyway, this new test is a bit cumbersome because it's required to mock all the behaviours related to variants configuration and capturing calls – If it is not desired im not hesitant to remove it.

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@github-actions github-actions bot added platform-android Android applications specifically tool Affects the "flutter" command-line tool. See also t: labels. labels Jul 13, 2025
@Sameri11 Sameri11 force-pushed the fix-obsolete-gradle-api branch 2 times, most recently from ed8c552 to d5251c2 Compare July 14, 2025 05:42
@Sameri11 Sameri11 force-pushed the fix-obsolete-gradle-api branch from d5251c2 to 05bc958 Compare July 14, 2025 08:28
@Sameri11 Sameri11 marked this pull request as ready for review July 14, 2025 09:25
@Sameri11 Sameri11 requested review from a team and matanlurey as code owners July 14, 2025 09:25
@Suppress("DEPRECATION")
fileMode = 420 // corresponds to unix 0644 in base 8
filePermissions {
user {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this actually needed?
"FILE: read &write for OWNER, read for GROUP, read for OTHER (0644, rw-r--r--)"
https://docs.gradle.org/current/kotlin-dsl/gradle/org.gradle.api.file/-file-permissions/index.html

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Interesting question, because in Copy task docs:
"If the property has no value set, that means that existing permissions are preserved." https://docs.gradle.org/current/dsl/org.gradle.api.tasks.Copy.html

I don't know how exactly these 2 parts corresponds to each other, best guess is that your link describes behavior out of context of Copy task?

Copy link
Contributor

Choose a reason for hiding this comment

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

That is Weird. LGTM Thank you for expanding test coverage.

@reidbaker reidbaker requested a review from gmackall July 14, 2025 15:54
@gmackall gmackall added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 15, 2025
@auto-submit auto-submit bot added this pull request to the merge queue Jul 15, 2025
Merged via the queue into flutter:master with commit adca65f Jul 15, 2025
149 checks passed
@flutter-dashboard flutter-dashboard bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jul 15, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 16, 2025
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Jul 16, 2025
flutter/flutter@cc3110c...c2739f0

2025-07-16 engine-flutter-autoroll@skia.org Roll Dart SDK from 2f2dd1780d45 to 766ee8029b11 (2 revisions) (flutter/flutter#172226)
2025-07-16 engine-flutter-autoroll@skia.org Roll Skia from af685eaf1b52 to 59be8479c637 (3 revisions) (flutter/flutter#172208)
2025-07-16 dkwingsmt@users.noreply.github.com Add dartpad example to `RoundedSuperellipseBorder` (flutter/flutter#172185)
2025-07-16 engine-flutter-autoroll@skia.org Roll Skia from ab79199bd0f3 to af685eaf1b52 (2 revisions) (flutter/flutter#172195)
2025-07-16 engine-flutter-autoroll@skia.org Roll Dart SDK from a4e60e5add75 to 2f2dd1780d45 (8 revisions) (flutter/flutter#172197)
2025-07-16 137456488+flutter-pub-roller-bot@users.noreply.github.com Roll pub packages (flutter/flutter#172193)
2025-07-15 30870216+gaaclarke@users.noreply.github.com Licenses_cpp: Parses NOTICES and DEPS (flutter/flutter#172044)
2025-07-15 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from tQAtsLtpc0oBIqRwC... to JRFUXSNXExcfjVYvA... (flutter/flutter#172189)
2025-07-15 engine-flutter-autoroll@skia.org Roll Skia from fec78c0da2e6 to ab79199bd0f3 (4 revisions) (flutter/flutter#172186)
2025-07-15 matanlurey@users.noreply.github.com Allow a release without engine cherrypicks (adds fallback logic) (flutter/flutter#172184)
2025-07-15 kjlubick@users.noreply.github.com [skia] Add missing param to makeRasterImage calls (flutter/flutter#172122)
2025-07-15 51940183+Sameri11@users.noreply.github.com [Android] remove obsolete gradle api in FGP (flutter/flutter#172085)
2025-07-15 engine-flutter-autoroll@skia.org Roll Skia from 8ffff8c8e01b to fec78c0da2e6 (6 revisions) (flutter/flutter#172178)
2025-07-15 engine-flutter-autoroll@skia.org Roll Skia from 2f4ad5d83704 to 8ffff8c8e01b (7 revisions) (flutter/flutter#172169)
2025-07-15 ivan.inozemtsev@gmail.com Roll Dart SDK to 3.9.0-333.2.beta (flutter/flutter#172167)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC bmparr@google.com,stuartmorgan@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform-android Android applications specifically tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy