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 key & value to ensure that the build process 
wont fail. Only the `MAX_SDK_VERSION` key would remain deleted, if they decided 
to remove this key, as we do not want to enforce a max SDK version.




-- 
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]

Reply via email to