Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update recommended build tool & library versions #252

Merged
merged 1 commit into from
Feb 21, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions intercom-plugin/src/android/build-extras-intercom.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ android.defaultConfig.applicationId [email protected]()
// some libraries depend on higher versions of our dependencies than we support
// we keep track of these dependencies here and override the version to a safe one
def safeVersions = [
"com.android.support:support-v4": "26.+"
"com.android.support:support-v4": "27.+"
]

def badVersionIndicators = [
Expand Down Expand Up @@ -50,31 +50,31 @@ private static String guideUrl() {

private void logIfIncorrectCompileSdkVersion() {
// this can be `{number}` or `android-{number}`
// regex checks that it ends with a number between 16 and 25 inclusive
if (cdvCompileSdkVersion != null && cdvCompileSdkVersion =~ /.*(1[6-9]|2[0-5])$/) {
// regex checks that it ends with a number between 16 and 26 inclusive
if (cdvCompileSdkVersion != null && cdvCompileSdkVersion =~ /.*(1[6-9]|2[0-6])$/) {
logger.error("${errorPrefix()} cdvCompileSdkVersion = ${cdvCompileSdkVersion}. \n" +
"You need to use a cdvCompileSdkVersion of at least 26.\n" +
"You need to use a cdvCompileSdkVersion of at least 27.\n" +
"See here for more: ${guideUrl()}\n")
}
}

private void logIfIncorrectBuildToolsVersion() {
// regex checks for a major version between 16 and 25 inclusive
if (cdvBuildToolsVersion != null && cdvBuildToolsVersion =~ /(1[6-9]|2[0-5])\..+$/) {
// regex checks for a major version between 16 and 26 inclusive
if (cdvBuildToolsVersion != null && cdvBuildToolsVersion =~ /(1[6-9]|2[0-6])\..+$/) {
logger.error("${errorPrefix()} cdvBuildToolsVersion = ${cdvBuildToolsVersion}. \n" +
"You need to use a cdvBuildToolsVersion of at least 26.0.0.\n" +
"You need to use a cdvBuildToolsVersion of at least 27.0.0.\n" +
"See here for more: ${guideUrl()}\n")
}
}

private void logIncompatibleDependencies(config) {
config.resolvedConfiguration.resolvedArtifacts.each {
def artifact = it.moduleVersion.id
// check Support Library versions are 26.x
// regex checks for a major version between 16 and 25 inclusive
if (artifact.group == "com.android.support" && artifact.version =~ /^(1[6-9]|2[0-5])\./) {
// check Support Library versions are 27.x
// regex checks for a major version between 16 and 26 inclusive
if (artifact.group == "com.android.support" && artifact.version =~ /^(1[6-9]|2[0-6])\./) {
logger.error("${errorPrefix()} Build config ${config.name} has dependency: ${artifact}\n" +
"The Intercom SDK requires version 26.x or higher of this dependency.\n" +
"The Intercom SDK requires version 27.x or higher of this dependency.\n" +
"Check your plugins to see if any of them are bringing in this dependency")
}
// check Play Services/Firebase versions are 11.x
Expand Down