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 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)
GradleCoordinate
groupId
- 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 matchpublic 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)