boolean (@Nullable String targetVersions, boolean checkBaseVersions) { if (targetVersions == null || targetVersions.isEmpty()) return true; final GradleVersion current = adjust(myGradleVersion, checkBaseVersions); if (targetVersions.endsWith("+")) { String minVersion = targetVersions.substring(0, targetVersions.length() - 1); return compare(current, minVersion, checkBaseVersions) >= 0; } else if (targetVersions.startsWith("!")) { String version = targetVersions.substring(1); return compare(current, version, checkBaseVersions) != 0; } else if (targetVersions.startsWith("<")) { if (targetVersions.startsWith("<=")) { String maxVersion = targetVersions.substring(2); return compare(current, maxVersion, checkBaseVersions) <= 0; } else { String maxVersion = targetVersions.substring(1); return compare(current, maxVersion, checkBaseVersions) < 0; } } else { final int rangeIndex = targetVersions.indexOf(RANGE_TOKEN); if (rangeIndex != -1) { String minVersion = targetVersions.substring(0, rangeIndex); String maxVersion = targetVersions.substring(rangeIndex + RANGE_TOKEN.length()); return compare(current, minVersion, checkBaseVersions) >= 0 && compare(current, maxVersion, checkBaseVersions) <= 0; } else { return compare(current, targetVersions, checkBaseVersions) == 0; } } }