Skip to content

fix: gradle deprecation warnings about property assignment#1821

Merged
erisu merged 1 commit intoapache:masterfrom
GitToTheHub:pr-make-properties-assignment-compatible-with-gradle-10
Jul 9, 2025
Merged

fix: gradle deprecation warnings about property assignment#1821
erisu merged 1 commit intoapache:masterfrom
GitToTheHub:pr-make-properties-assignment-compatible-with-gradle-10

Conversation

@GitToTheHub
Copy link
Contributor

When building a plain Android Cordova app without plugins, there will be Gradle depraction warnings: Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.. Compiling it with --warning-mode all shows, that some properties are assigned without an =, which will not be supported any longer with Gradle 10.0.

Platforms affected

Android

Motivation and Context

Description

Testing

Checklist

  • I've run the tests to see all new and existing tests pass
  • I added automated test coverage as appropriate for this change
  • Commit is prefixed with (platform) if this change only applies to one platform (e.g. (android))
  • If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct keyword to close issues using keywords)
  • I've updated the documentation if necessary

When building a plain Android Cordova app without plugins, there will be Gradle depraction warnings: `Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.`. Compiling it with `--warning-mode all` shows, that some properties are assigned without an `=`, which will not be supported any longer with Gradle 10.0.
Copy link
Member

@dpogue dpogue left a comment

Choose a reason for hiding this comment

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

I'm guessing namespace needs the = because it's a property and compileSdkVersion doesn't because it's... not a property? And the only way to know that is to dig into gradle documentation? 😕

The changes seem fine to me, I just worry that now it looks inconsistent and it's not going to be obvious in future changes when a = is needed or not (but that's Gradle's fault, not your fault)

@codecov-commenter
Copy link

codecov-commenter commented Jul 8, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.24%. Comparing base (cab5c5b) to head (761ec12).
⚠️ Report is 8 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1821      +/-   ##
==========================================
+ Coverage   72.12%   72.24%   +0.11%     
==========================================
  Files          23       23              
  Lines        1844     1841       -3     
==========================================
  Hits         1330     1330              
+ Misses        514      511       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@breautek
Copy link
Contributor

breautek commented Jul 8, 2025

I'm guessing namespace needs the = because it's a property and compileSdkVersion doesn't because it's... not a property? And the only way to know that is to dig into gradle documentation? 😕

The changes seem fine to me, I just worry that now it looks inconsistent and it's not going to be obvious in future changes when a = is needed or not (but that's Gradle's fault, not your fault)

I believe compileSdkVersion is also deprecated in favour for compileSdk which is a property that you do "assign", vs compileSdkVersion which is actually a method, that you supply a single argument into.

The Kotlin DSL is much more strict on this stuff, but is also much more streamlined/consistent. I think it will be pretty easy to migrate too, kotlin gradle I believe can still reference groovy gradle for extensions (like build-extras.gradle)... so might be worth considering doing in one of our major releases at some point.

@GitToTheHub
Copy link
Contributor Author

I was just correcting, what Gradle complained about. I'm also wondering, why some things should be properties and some not. When I look for the namespace property on Google's documentation it's even there not documented with an = for Groovy.

@erisu erisu changed the title Android: Fix gradle deprecation warnings about property assignment fix: gradle deprecation warnings about property assignment Jul 9, 2025
@erisu erisu merged commit df36c7a into apache:master Jul 9, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants