chore(android): clear the Gradle 10 deprecations, verified against the artifacts - #471
Conversation
…e artifacts
Four call sites the Android build was warning about, each checked against the
actual artifact rather than against the warning text.
## What the build was saying
* `AndroidSourceDirectorySet.srcDir(Any)` is deprecated -- "Use `directories`
mutable set instead" (two sites).
* Two Kotlin DSL DELEGATED PROPERTIES, `by tasks.registering(Exec::class)`,
with three warnings apiece pointing at the Gradle 9.6 upgrading guide.
* `currentWindowAdaptiveInfo()` -- "Please use V2 version of this function to
support L and XL width size classes."
* And the summary: "Deprecated Gradle features were used in this build,
making it incompatible with Gradle 10."
## Verified, not inferred
THE VERSION I READ FIRST WAS THE WRONG ONE. `AndroidSourceDirectorySet` came out
of the AGP jar the local Gradle cache happened to hold -- 9.2.1 -- while this
branch pins 9.3.2 and the warning came from 9.3.2. Re-read from the pinned
artifact, downloaded for the purpose. The interface is identical, so the fix
stands, but it stood on the wrong evidence until it was checked.
What the interface actually says: `getDirectories()` returns `Set<String>`, so
the replacement takes PATHS and the call sites pass `.path`, not the `File`.
That is not deducible from "use `directories` mutable set instead".
`currentWindowAdaptiveInfoV2` was confirmed present in `material3.adaptive`
1.3.0 by extracting the AAR -- AND CONFIRMED ABSENT IN 1.2.0, which is what
makes this change depend on the version bump beside it rather than being
independent of it.
Gradle's upgrade guide is explicit on the delegates: `registering`, `creating`,
`existing` and `getting` are all deprecated and scheduled for removal in
Gradle 10, replaced by `register`, `create`, `named` and `getByName`.
## Behaviour
Unchanged. The two breakpoints tested against the adaptive info are both "at
least", so a window that now reports the new L or XL width class still
satisfies EXPANDED -- V2 reports more classes, it does not reclassify the ones
already handled.
## The warning that names nothing
The build also runs with `--warning-mode all` now. Gradle's summary line says
the build is incompatible with Gradle 10 and identifies not one cause; Gradle
itself says the flag is how you find out. A warning that cannot be attributed is
a warning nobody acts on, and this one has a deadline attached.
## Ordering
This MUST land after the dependency refresh that takes `material3.adaptive` to
1.3.0. `currentWindowAdaptiveInfoV2` does not exist in 1.2.0 -- checked, not
assumed -- so merged first it would break the build.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: Warning Your free Security trial is over. An organization admin can activate billing to continue. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Antigravity review (Gemini via Ultra)This PR clears Gradle 10 deprecations by updating Kotlin DSL task registrations, using AGP's updated source directory properties, migrating to the V2 adaptive window info API, and surfacing detailed warning logs in CI. Blocking issues
Suggestions
Nitpicks
Automated first-pass review by |
Replying to the Antigravity reviewBlocking issue — The finding is a good one and its criticism of my evidence was fair: the commit said "verified against the interface", and an interface returning But the run-test you asked for had already run, on this PR. The Eighteen minutes, both flavours, Compose compilation and R8 included. Configuration is the first thing Gradle does — an Worth flagging one thing about that job for future reviews, because it cuts the other way and is easy to be misled by: it is Suggestion — remove the "conversational" comments: declined. This is a genuine style disagreement rather than an oversight. I take the point that a comment should not read as a changelog entry, and if any of these drift that way they are worth trimming. But the measurements themselves are the content, not decoration around it. |
Four call sites the Android build was warning about, each checked against the
actual artifact rather than against the warning text.
What the build was saying
AndroidSourceDirectorySet.srcDir(Any)— "Usedirectoriesmutable setinstead" (two sites).
by tasks.registering(Exec::class)),three warnings apiece, pointing at the Gradle 9.6 upgrading guide.
currentWindowAdaptiveInfo()— "Please use V2 version of this function tosupport L and XL width size classes."
it incompatible with Gradle 10."
Verified, not inferred
The version I read first was the wrong one.
AndroidSourceDirectorySetcameout of the AGP jar the local Gradle cache happened to hold — 9.2.1 — while
the build pins 9.3.2, and the warning came from 9.3.2. Re-read from the
pinned artifact, downloaded for the purpose. The interface is identical, so the
fix stands — but it stood on the wrong evidence until it was checked.
What the interface actually says:
getDirectories()returnsSet<String>, sothe replacement takes paths and the call sites pass
.path, not theFile.That is not deducible from "use
directoriesmutable set instead".currentWindowAdaptiveInfoV2was confirmed present inmaterial3.adaptive1.3.0 by extracting the AAR — and confirmed absent in 1.2.0, which is what
made this change depend on #469 rather than being independent of it. It is
sequenced after that merge for exactly that reason.
Gradle's upgrade guide is explicit on the delegates:
registering,creating,existingandgettingare all deprecated and scheduled for removal inGradle 10, replaced by
register,create,namedandgetByName.Behaviour
Unchanged. Both breakpoints tested against the adaptive info are "at least", so
a window that now reports the new L or XL width class still satisfies EXPANDED —
V2 reports more classes, it does not reclassify the ones already handled.
The warning that names nothing
The build now runs with
--warning-mode all. Gradle's summary line says thebuild is incompatible with Gradle 10 and identifies not one cause; Gradle itself
says the flag is how you find out. A warning that cannot be attributed is a
warning nobody acts on, and this one has a deadline attached.
Verification
android.ymlruns on this PR. ItsGradle bundlejob iscontinue-on-error, soits conclusion is not evidence — the step results and the build log will be
read before this is called green.