public class MavenRepositories
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.io.File |
getArtifactDirectory(java.io.File repository,
GradleCoordinate coordinate) |
static java.io.File |
getArtifactIdDirectory(java.io.File repository,
java.lang.String groupId,
java.lang.String artifactId) |
static GradleCoordinate |
getHighestInstalledVersion(java.lang.String groupId,
java.lang.String artifactId,
java.io.File repository,
java.util.function.Predicate<GradleVersion> filter,
boolean allowPreview,
com.android.repository.io.FileOp fileOp)
Finds the best matching
GradleCoordinate . |
static GradleVersion |
getHighestInstalledVersionNumber(java.lang.String groupId,
java.lang.String artifactId,
java.io.File repository,
java.util.function.Predicate<GradleVersion> filter,
boolean allowPreview,
com.android.repository.io.FileOp fileOp)
Finds the best matching
GradleVersion . |
static GradleVersion |
getHighestVersion(java.io.File versionDir,
java.util.function.Predicate<GradleVersion> filter,
boolean allowPreview,
com.android.repository.io.FileOp fileOp)
Given a directory containing version numbers returns the highest version number
matching the given filter
|
static java.io.File |
getMavenMetadataFile(java.io.File repository,
java.lang.String groupId,
java.lang.String artifactId) |
static boolean |
isPreview(GradleCoordinate coordinate)
Decides whether a given
GradleCoordinate is considered preview. |
@Nullable public static GradleCoordinate getHighestInstalledVersion(@NonNull java.lang.String groupId, @NonNull java.lang.String artifactId, @NonNull java.io.File repository, @Nullable java.util.function.Predicate<GradleVersion> filter, boolean allowPreview, @NonNull com.android.repository.io.FileOp fileOp)
GradleCoordinate
.groupId
- the artifact group idartifactId
- the artifact idrepository
- the path to the m2repository directoryfilter
- an optional version filter that has to be satisfied by the matched coordinateallowPreview
- whether preview versions are allowed to match@Nullable public static GradleVersion getHighestInstalledVersionNumber(@NonNull java.lang.String groupId, @NonNull java.lang.String artifactId, @NonNull java.io.File repository, @Nullable java.util.function.Predicate<GradleVersion> filter, boolean allowPreview, @NonNull com.android.repository.io.FileOp fileOp)
GradleVersion
. Like
getHighestInstalledVersion(String, String, File, Predicate, boolean, FileOp)
but
operates on GradleVersion
instead of GradleCoordinate
.groupId
- the artifact group idartifactId
- the artifact idrepository
- the path to the m2repository directoryfilter
- an optional filter which the matched version must satisfyallowPreview
- whether preview versions are allowed to matchfileOp
- file operator to use for file access@Nullable public static GradleVersion getHighestVersion(@NonNull java.io.File versionDir, @Nullable java.util.function.Predicate<GradleVersion> filter, boolean allowPreview, @NonNull com.android.repository.io.FileOp fileOp)
versionDir
- the directory containing version numbersfilter
- an optional filter which the matched version must satisfyallowPreview
- whether preview versions are allowed to matchfileOp
- file operator to use for file accesspublic static boolean isPreview(GradleCoordinate coordinate)
GradleCoordinate
is considered preview.
This is mostly compatible with GradleCoordinate.isPreview()
, but there is one edge
case that we need to handle, related to Play Services. (See https://b.android.com/75292)
public static java.io.File getArtifactIdDirectory(@NonNull java.io.File repository, @NonNull java.lang.String groupId, @NonNull java.lang.String artifactId)
public static java.io.File getArtifactDirectory(@NonNull java.io.File repository, @NonNull GradleCoordinate coordinate)
public static java.io.File getMavenMetadataFile(@NonNull java.io.File repository, @NonNull java.lang.String groupId, @NonNull java.lang.String artifactId)