erisu commented on a change in pull request #1212:
URL: https://github.com/apache/cordova-android/pull/1212#discussion_r663475222
##########
File path: framework/cordova.gradle
##########
@@ -151,12 +150,44 @@ def doGetConfigPreference(name, defaultValue) {
return ret
}
+def doApplyCordovaConfigCustomization() {
+ // Apply user overide properties that comes from the "--gradleArg=-P"
parameters
+ if (project.hasProperty('cdvMinSdkVersion')) {
+ cordovaConfig.MIN_SDK_VERSION = Integer.parseInt('' + cdvMinSdkVersion)
+ }
+ if (project.hasProperty('cdvSdkVersion')) {
+ cordovaConfig.SDK_VERSION = Integer.parseInt('' + cdvSdkVersion)
+ }
+ if (project.hasProperty('cdvMaxSdkVersion')) {
+ cordovaConfig.MAX_SDK_VERSION = Integer.parseInt('' + cdvMaxSdkVersion)
+ }
+ if (project.hasProperty('cdvBuildToolsVersion')) {
+ cordovaConfig.BUILD_TOOLS_VERSION = cdvBuildToolsVersion
+ }
+ if (project.hasProperty('cdvAndroidXAppCompatVersion')) {
+ cordovaConfig.ANDROIDX_APP_COMPAT_VERSION = cdvAndroidXAppCompatVersion
+ }
+
+ // Ensure the latest installed build tools is selected, with or without
defined override
+ cordovaConfig.LATEST_INSTALLED_BUILD_TOOLS =
doFindLatestInstalledBuildTools(
+ cordovaConfig.BUILD_TOOLS_VERSION
+ )
+}
+
// Properties exported here are visible to all plugins.
ext {
+ def jsonFile = new File("$rootDir/config.json")
+ def parsedJson = new groovy.json.JsonSlurper().parseText(jsonFile.text)
+
+ cordovaConfig = parsedJson
Review comment:
I dont why it is split but maybe it can be merged together.
I have sometimes seen unusual cases where Gradle doesnt work like how you
would expect. I am not sure if this was one of them.
--
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]