/** * Returns the version in a fixed format major.minor.micro with an optional "rc preview#". For * example it would return "18.0.0", "18.1.0" or "18.1.2 rc5", with the separator between the * main version number and the preview component being specified by {@code previewSeparator}. */ public String toString(@NonNull String previewSeparator) { StringBuilder sb = new StringBuilder(); sb.append(getMajor()); if (mPrecision.compareTo(Precision.MINOR) >= 0) { sb.append('.').append(getMinor()); if (mPrecision.compareTo(Precision.MICRO) >= 0) { sb.append('.').append(getMicro()); if (mPrecision.compareTo(Precision.PREVIEW) >= 0 && isPreview()) { sb.append(previewSeparator).append("rc").append(getPreview()); } } } return sb.toString(); }
/** * Creates a new revision with at least three components (major, minor, micro) * based on the given revision. This is important since in the past we would * sometimes write out revisions with only one component when internally we * required that they have more, and would convert using the specific Revision * subclass. * @param rev * @return */ private static Revision fullySpecifyRevision(Revision rev) { // Since we used to require a complete revision if (!rev.isPreview()) { rev = new Revision(rev.getMajor(), rev.getMinor(), rev.getMicro()); } return rev; }
/** * Creates a copy of the specified {@code Revision}. */ public Revision(@NonNull Revision revision) { this(revision.getMajor(), revision.getMinor(), revision.getMicro(), revision.getPreview(), revision.mPrecision, revision.getSeparator()); }
boolean isOldBuildTools = buildTools != null && (buildTools.getMajor() < 23 || buildTools.getMajor() == 23 && buildTools.getMinor() == 0 && buildTools.getMicro() == 0); if ((buildTools == null || isOldBuildTools) && viewMayExtendTextView(attribute.getOwnerElement())) {
version.getMicro() == 0 && context.isEnabled(COMPATIBILITY)) {
private static Revision getNewerRevision(@NonNull GradleCoordinate dependency, @NonNull Revision revision) { assert dependency.getGroupId() != null; assert dependency.getArtifactId() != null; GradleCoordinate coordinate; if (revision.isPreview()) { String coordinateString = dependency.getGroupId() + ":" + dependency.getArtifactId() + ":" + revision.toString(); coordinate = GradleCoordinate.parseCoordinateString(coordinateString); } else { coordinate = new GradleCoordinate(dependency.getGroupId(), dependency.getArtifactId(), revision.getMajor(), revision.getMinor(), revision.getMicro()); } if (COMPARE_PLUS_HIGHER.compare(dependency, coordinate) < 0) { return revision; } else { return null; } }
dependency.isPreview()); if (latest != null && isOlderThan(dependency, latest.getMajor(), latest.getMinor(), latest.getMicro())) { version = latest; issue = REMOTE_VERSION;
result[1] = getMinor(); if (mPrecision.compareTo(Precision.MICRO) >= 0) { result[2] = getMicro();
if (compileSdkVersion == 23) { if (revision.getMajor() > 23 || revision.getMajor() == 23 && (revision.getMinor() > 0 || revision.getMicro() > 0)) { return;