You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "beroso (via GitHub)" <gi...@apache.org> on 2025/07/04 14:20:04 UTC
[PR] Allows additional settings to be included on settings.gradle [cordova-android]
beroso opened a new pull request, #1819:
URL: https://github.com/apache/cordova-android/pull/1819
### Motivation and Context
I'm integrating a flutter module inside a ionic cordova app. So accordingly to the [flutter guide](https://docs.flutter.dev/add-to-app/android/project-setup#depend-on-the-modules-source-code) I need to put the following config on settings.gradle.
```gradle
setBinding(new Binding([gradle: this]))
def filePath = settingsDir.parentFile.toString() + "/flutter_module/.android/include_flutter.groovy"
apply from: filePath
```
But the file is regenerated on each build, and my changes are lost.
### Description
Sometimes we need some extra settings on settings.gradle file, but the file is regenerated on each build.
The proposed solution applies a `settings-additional.gradle` file (if it exists) to the `settings.gradle`.
### Testing
<!-- Please describe in detail how you tested your changes. -->
### 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](https://help.github.com/articles/closing-issues-using-keywords/))
- [ ] I've updated the documentation if necessary
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
Re: [PR] feat: Allows additional settings to be included on settings.gradle [cordova-android]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #1819:
URL: https://github.com/apache/cordova-android/pull/1819#issuecomment-3036565853
## [Codecov](https://app.codecov.io/gh/apache/cordova-android/pull/1819?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Project coverage is 72.07%. Comparing base [(`484c60e`)](https://app.codecov.io/gh/apache/cordova-android/commit/484c60e48362952d26ce6b0dd90116f5811c27b7?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`99027c5`)](https://app.codecov.io/gh/apache/cordova-android/commit/99027c52ea96c7b59f1d4f8100344d1ad39f1335?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #1819 +/- ##
==========================================
- Coverage 72.12% 72.07% -0.06%
==========================================
Files 23 23
Lines 1844 1844
==========================================
- Hits 1330 1329 -1
- Misses 514 515 +1
```
</details>
[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/cordova-android/pull/1819?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
Re: [PR] feat: Allows additional settings to be included on settings.gradle [cordova-android]
Posted by "breautek (via GitHub)" <gi...@apache.org>.
breautek commented on code in PR #1819:
URL: https://github.com/apache/cordova-android/pull/1819#discussion_r2185553061
##########
lib/builders/ProjectBuilder.js:
##########
@@ -205,7 +205,8 @@ class ProjectBuilder {
'// GENERATED FILE - DO NOT EDIT\n' +
'apply from: "cdv-gradle-name.gradle"\n' +
'include ":"\n' +
- settingsGradlePaths.join(''));
+ settingsGradlePaths.join('') +
+ '\nif (file("settings-additional.gradle").exists()) { apply from: "settings-additional.gradle" }\n');
Review Comment:
we have a concept of `build-extras.gradle` which is virtually the same thing but for the build.gradle file. So I'm thinking to keep naming consist we should actually look for `settings-extra.gradle`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
Re: [PR] feat: Allows additional settings to be included on settings.gradle [cordova-android]
Posted by "erisu (via GitHub)" <gi...@apache.org>.
erisu merged PR #1819:
URL: https://github.com/apache/cordova-android/pull/1819
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
Re: [PR] feat: Allows additional settings to be included on settings.gradle [cordova-android]
Posted by "breautek (via GitHub)" <gi...@apache.org>.
breautek commented on PR #1819:
URL: https://github.com/apache/cordova-android/pull/1819#issuecomment-3036572086
I think this is a good clean enhancement and I think there isn't a risk of a breaking change. Because we have the same concept for `build-extras.gradle`, I don't think there is any issue doing the same for settings. Considering that Apache just made a release not that long ago, it might be some time before a feature release is made however.
A workaround that should work in the meantime if you don't want to use a custom version of cordova-android is the [after prepare hook](https://cordova.apache.org/docs/en/12.x-2025.01/guide/appdev/hooks/index.html). It should allow you to manipulate the `settings.gradle` after Cordova has generated the file.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org