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.lang.String filter,
boolean allowPreview)
Deprecated.
For testability, use
getHighestInstalledVersion(String,
String, File, String, boolean, FileOp). |
static GradleCoordinate |
getHighestInstalledVersion(java.lang.String groupId,
java.lang.String artifactId,
java.io.File repository,
java.lang.String filter,
boolean allowPreview,
com.android.repository.io.FileOp fileOp)
Find the best matching
GradleCoordinate |
static GradleVersion |
getHighestInstalledVersionNumber(java.lang.String groupId,
java.lang.String artifactId,
java.io.File repository,
java.lang.String filter,
boolean allowPreview,
com.android.repository.io.FileOp fileOp)
Find the best matching
GradleVersion. |
static GradleVersion |
getHighestVersion(java.io.File versionDir,
java.lang.String 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.lang.String filter, boolean allowPreview, @NonNull com.android.repository.io.FileOp fileOp)
GradleCoordinategroupId - the artifact group idartifactId - the artifact idrepository - the path to the m2repository directoryfilter - an optional filter which the matched coordinate's version name must start
withallowPreview - 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.lang.String filter, boolean allowPreview, @NonNull com.android.repository.io.FileOp fileOp)
GradleVersion. Like
getHighestInstalledVersion(String, String, File, String, 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 name must start withallowPreview - 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.lang.String filter, boolean allowPreview, @NonNull com.android.repository.io.FileOp fileOp)
versionDir - the directory containing version numbersfilter - an optional filter which the matched version name must start withallowPreview - 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)
@Deprecated @Nullable public static GradleCoordinate getHighestInstalledVersion(@NonNull java.lang.String groupId, @NonNull java.lang.String artifactId, @NonNull java.io.File repository, @Nullable java.lang.String filter, boolean allowPreview)
getHighestInstalledVersion(String,
String, File, String, boolean, FileOp).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)