erisu commented on a change in pull request #1212:
URL: https://github.com/apache/cordova-android/pull/1212#discussion_r663452890
##########
File path: bin/templates/cordova/lib/prepare.js
##########
@@ -92,6 +76,76 @@ module.exports.prepare = function (cordovaProject, options) {
});
};
+function updateUserProjectGradleConfig (configXml, defaultGradleConfigPath,
projectGradleConfigPath) {
+ const defaultGradleConfig = fs.readJSONSync(defaultGradleConfigPath);
+ const profileGradleConfig = fs.readJSONSync(projectGradleConfigPath);
+
+ // Replace modified configs with defaults
+ const mergedConfigs = Object.assign(profileGradleConfig,
defaultGradleConfig);
Review comment:
The only key that can be added and is not listed in the defaults is
`MAX_SDK_VERSION`.
Defining any random key is not a part of the use case, I beleive.
All default keys and `MAX_SDK_VERSION` has a reference somewhere in the
Gradle build process.
I remember this mergeing process was to ensure that if the user deleted one
of the default keys by mistake or removed their previous overriding setting, it
would reapply the original default keys & values to ensure that the build
process wont fail. Only the `MAX_SDK_VERSION` key would remain deleted, if they
decided to remove this key. We do not want to enforce a max SDK version by
default.
Also I think the merging covers cases of upgrading the platform. If we
introduce new keys, it will update their existing project config to add in the
new keys. Not everyone deletes the platforms and even some people commit it
into their repo.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]