mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-31 17:32:51 +08:00
fix: gradle build tools config (#1293)
This commit is contained in:
parent
5e50c1d611
commit
c11fcc10e8
@ -2,7 +2,7 @@
|
|||||||
"MIN_SDK_VERSION": 22,
|
"MIN_SDK_VERSION": 22,
|
||||||
"SDK_VERSION": 30,
|
"SDK_VERSION": 30,
|
||||||
"GRADLE_VERSION": "7.1.1",
|
"GRADLE_VERSION": "7.1.1",
|
||||||
"BUILD_TOOLS_VERSION": "30.0.3",
|
"MIN_BUILD_TOOLS_VERSION": "30.0.3",
|
||||||
"AGP_VERSION": "4.2.2",
|
"AGP_VERSION": "4.2.2",
|
||||||
"KOTLIN_VERSION": "1.5.20",
|
"KOTLIN_VERSION": "1.5.20",
|
||||||
"ANDROIDX_APP_COMPAT_VERSION": "1.3.0",
|
"ANDROIDX_APP_COMPAT_VERSION": "1.3.0",
|
||||||
|
@ -174,12 +174,22 @@ def doApplyCordovaConfigCustomization() {
|
|||||||
cordovaConfig.ANDROIDX_WEBKIT_VERSION = cdvAndroidXWebKitVersion
|
cordovaConfig.ANDROIDX_WEBKIT_VERSION = cdvAndroidXWebKitVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure the latest installed build tools is selected, with or without defined override
|
if (!cordovaConfig.BUILD_TOOLS_VERSION) {
|
||||||
cordovaConfig.LATEST_INSTALLED_BUILD_TOOLS = doFindLatestInstalledBuildTools(
|
cordovaConfig.BUILD_TOOLS_VERSION = doFindLatestInstalledBuildTools(
|
||||||
cordovaConfig.BUILD_TOOLS_VERSION
|
cordovaConfig.MIN_BUILD_TOOLS_VERSION
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ensure the configured build tools version is at least our declared minimum
|
||||||
|
def buildToolsVersion = new Version(cordovaConfig.BUILD_TOOLS_VERSION)
|
||||||
|
if (buildToolsVersion.isLowerThan(cordovaConfig.MIN_BUILD_TOOLS_VERSION)) {
|
||||||
|
throw new RuntimeException("""
|
||||||
|
Expected Android Build Tools version >= ${cordovaConfig.MIN_BUILD_TOOLS_VERSION},
|
||||||
|
but got Android Build Tools version ${cordovaConfig.BUILD_TOOLS_VERSION}. Please use version ${cordovaConfig.MIN_BUILD_TOOLS_VERSION} or later.
|
||||||
|
""".replaceAll(/\s+/, ' ').trim())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Properties exported here are visible to all plugins.
|
// Properties exported here are visible to all plugins.
|
||||||
ext {
|
ext {
|
||||||
def defaultsFilePath = './cdv-gradle-config-defaults.json'
|
def defaultsFilePath = './cdv-gradle-config-defaults.json'
|
||||||
|
@ -189,7 +189,7 @@ android {
|
|||||||
abortOnError false
|
abortOnError false
|
||||||
}
|
}
|
||||||
|
|
||||||
buildToolsVersion cordovaConfig.LATEST_INSTALLED_BUILD_TOOLS
|
buildToolsVersion cordovaConfig.BUILD_TOOLS_VERSION
|
||||||
|
|
||||||
// This code exists for Crosswalk and other Native APIs.
|
// This code exists for Crosswalk and other Native APIs.
|
||||||
// By default, we multiply the existing version code in the
|
// By default, we multiply the existing version code in the
|
||||||
|
Loading…
Reference in New Issue
Block a user