/** * Gets the path/unique id for the LLDB of the given {@link Revision}. * * TODO: consider moving to an LLDB-specific place. */ public static String getLldbPath(Revision revision) { return SdkConstants.FD_LLDB + RepoPackage.PATH_SEPARATOR + revision.getMajor() + "." + revision.getMinor(); }
@Override public int getRevision() { return mPackage.getVersion().getMajor(); }
@Override public int getRevision() { return mPackage.getVersion().getMajor(); }
/** * 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(); }
if (v != null && v.getMajor() == major) { revisions.add(v);
/** * 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()); }
Revision rev = getRevision(); sb.append(mType.getFolderName()).append('-'); sb.append(rev.getMajor()); sb.append('.'); sb.append(rev.getMinor());
if (version != null) { Revision recommended = getLatestBuildTools(context.getClient(), version.getMajor()); if (recommended != null && version.compareTo(recommended) < 0) { if (version.getMajor() == 23 && version.getMinor() == 0 && version.getMicro() == 0 && context.isEnabled(COMPATIBILITY)) { if (recommended == null || recommended.getMajor() < 23) {
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; } }
Revision latest = getLatestVersionFromRemoteRepo(context.getClient(), dependency, dependency.isPreview()); if (latest != null && isOlderThan(dependency, latest.getMajor(), latest.getMinor(), latest.getMicro())) { version = latest;
result = new int[mPrecision.getTermCount()]; result[0] = getMajor(); if (mPrecision.compareTo(Precision.MINOR) >= 0) { result[1] = getMinor();
.getSplitHandlingPolicy() .equals(SplitHandlingPolicy.RELEASE_21_AND_AFTER_POLICY)) { if (getExtension().getBuildToolsRevision().getMajor() < 21) { throw new RuntimeException( "Pure splits can only be used with buildtools 21 and later");