Skip to content

Bump Dependency Analysis Gradle Plugin to 3.14.0 and filter R-class duplicate warnings#4321

Closed
rvandermeulen wants to merge 1 commit into
masterfrom
bump-dagp
Closed

Bump Dependency Analysis Gradle Plugin to 3.14.0 and filter R-class duplicate warnings#4321
rvandermeulen wants to merge 1 commit into
masterfrom
bump-dagp

Conversation

@rvandermeulen
Copy link
Copy Markdown
Contributor

@rvandermeulen rvandermeulen commented May 28, 2026

R classes are duplicated by design between :app and its library dependencies (the app re-generates R/R$id/etc. for resources it references), so DAGP's duplicate-class detection flags them as false positives, e.g.:

androidx/appcompat/R is provided by multiple dependencies: [:app, androidx.appcompat:appcompat:1.7.1]
mozilla/components/browser/menu/R$id is provided by multiple dependencies: [:app, org.mozilla.components:browser-menu:...]

Rather than disabling duplicate-class detection entirely (which we still want for genuine classpath conflicts / supply-chain risks), this scopes an excludeRegex to just the R classes via the onDuplicateClassWarnings handler.

This is tracked upstream in autonomousapps/dependency-analysis-gradle-plugin#1335.

…uplicate warnings

R classes are duplicated by design between :app and its library dependencies,
so DAGP's duplicate-class detection flags them as false positives. Filter them
via excludeRegex rather than disabling the check entirely.

autonomousapps/dependency-analysis-gradle-plugin#1335
@rvandermeulen rvandermeulen added the needs landing Auto lands approved and green PRs. label May 28, 2026
@rvandermeulen rvandermeulen requested a review from jonalmeida May 28, 2026 20:34
Copy link
Copy Markdown
Collaborator

@jonalmeida jonalmeida left a comment

Choose a reason for hiding this comment

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

The activity on the linked bug is a bit disappointing, but this type of change will suffice.

My regex-foo is a bit weak off late, but I think we need to make this expression more strict, so that it doesn't catch other classes, but also allows for importing resource strings.

I used this regex test site that checked the expression against some test values:

Image

In the above screenshot, import org.mozilla.fenix.GleanMetrics.RecentSyncedTabs should not have been caught.

@rvandermeulen
Copy link
Copy Markdown
Contributor Author

Not entirely sure I agree with the pushback here, but it's also moot because I got a PR landed upstream today to resolve this issue. I'll open a new PR for that DAGP update once it becomes available.

@rvandermeulen rvandermeulen deleted the bump-dagp branch June 3, 2026 04:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs landing Auto lands approved and green PRs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants