public enum SdkMavenRepository extends java.lang.Enum<SdkMavenRepository>
extras
folder of the
SDK location.Enum Constant and Description |
---|
ANDROID
The Android repository; contains support lib, app compat, media router, etc
|
GOOGLE
The Google repository; contains Play Services etc
|
Modifier and Type | Method and Description |
---|---|
static SdkMavenRepository |
find(java.io.File sdkLocation,
java.lang.String groupId,
java.lang.String artifactId,
com.android.repository.io.FileOp fileOp)
Returns the SDK repository which contains the given artifact, of null if a matching directory
cannot be found in any SDK directory.
|
static com.android.repository.api.RepoPackage |
findBestPackageMatching(GradleCoordinate coordinate,
java.util.Collection<? extends com.android.repository.api.RepoPackage> packages)
Given a collection of
RepoPackage s, find the one that best matches the given
GradleCoordinate (that is, the one that corresponds to the maven artifact with the
same version, or the highest package matching a coordinate with +). |
static GradleCoordinate |
getCoordinateFromSdkPath(java.lang.String path)
Given
RepoPackage -style path , get the
GradleCoordinate for the package (assuming it is a maven-style package). |
java.lang.String |
getDirName()
The directory name of the repository inside the extras folder
|
GradleCoordinate |
getHighestInstalledVersion(java.io.File sdkHome,
java.lang.String groupId,
java.lang.String artifactId,
java.lang.String filter,
boolean allowPreview)
Deprecated.
For testability use
getHighestInstalledVersion(File, String, String, String, boolean, FileOp) |
GradleCoordinate |
getHighestInstalledVersion(java.io.File sdkHome,
java.lang.String groupId,
java.lang.String artifactId,
java.lang.String filter,
boolean allowPreview,
com.android.repository.io.FileOp fileOp)
Find the best matching
GradleCoordinate |
java.lang.String |
getPackageId() |
java.io.File |
getRepositoryLocation(java.io.File sdkHome,
boolean requireExists)
Deprecated.
For testability, use
getRepositoryLocation(File, boolean, FileOp) . |
java.io.File |
getRepositoryLocation(java.io.File sdkHome,
boolean requireExists,
com.android.repository.io.FileOp fileOp)
Returns the location of the repository within a given SDK home
|
boolean |
isInstalled(com.android.sdklib.repository.AndroidSdkHandler sdkHandler)
Returns true if the given SDK repository is installed
|
boolean |
isInstalled(java.io.File sdkHome,
com.android.repository.io.FileOp fileOp)
Returns true if the given SDK repository is installed
|
static SdkMavenRepository |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static SdkMavenRepository[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final SdkMavenRepository ANDROID
public static final SdkMavenRepository GOOGLE
public static SdkMavenRepository[] values()
for (SdkMavenRepository c : SdkMavenRepository.values()) System.out.println(c);
public static SdkMavenRepository valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null@Deprecated @Nullable public java.io.File getRepositoryLocation(@Nullable java.io.File sdkHome, boolean requireExists)
getRepositoryLocation(File, boolean, FileOp)
.@Nullable public java.io.File getRepositoryLocation(@Nullable java.io.File sdkHome, boolean requireExists, @NonNull com.android.repository.io.FileOp fileOp)
sdkHome
- the SDK home, or nullrequireExists
- if true, the location will only be returned if it also existspublic boolean isInstalled(@Nullable java.io.File sdkHome, @NonNull com.android.repository.io.FileOp fileOp)
sdkHome
- the SDK installation locationpublic boolean isInstalled(@Nullable com.android.sdklib.repository.AndroidSdkHandler sdkHandler)
sdkHandler
- the SDK to checkpublic java.lang.String getPackageId()
@Deprecated public GradleCoordinate getHighestInstalledVersion(@Nullable java.io.File sdkHome, @NonNull java.lang.String groupId, @NonNull java.lang.String artifactId, @Nullable java.lang.String filter, boolean allowPreview)
getHighestInstalledVersion(File, String, String, String, boolean, FileOp)
@Nullable public GradleCoordinate getHighestInstalledVersion(@Nullable java.io.File sdkHome, @NonNull java.lang.String groupId, @NonNull java.lang.String artifactId, @Nullable java.lang.String filter, boolean allowPreview, @NonNull com.android.repository.io.FileOp fileOp)
GradleCoordinate
sdkHome
- the SDK installationgroupId
- the artifact group idartifactId
- the artifact idfilter
- an optional filter which the matched coordinate's version name must start
withallowPreview
- whether preview versions are allowed to matchfileOp
- To allow mocking of filesystem operations.@Nullable public static SdkMavenRepository find(@NonNull java.io.File sdkLocation, @NonNull java.lang.String groupId, @NonNull java.lang.String artifactId, @NonNull com.android.repository.io.FileOp fileOp)
@NonNull public java.lang.String getDirName()
@Nullable public static GradleCoordinate getCoordinateFromSdkPath(@NonNull java.lang.String path)
RepoPackage
-style path
, get the
GradleCoordinate
for the package (assuming it is a maven-style package).GradleCoordinate
, or null if the package is not a maven-style package.@Nullable public static com.android.repository.api.RepoPackage findBestPackageMatching(@NonNull GradleCoordinate coordinate, @NonNull java.util.Collection<? extends com.android.repository.api.RepoPackage> packages)
RepoPackage
s, find the one that best matches the given
GradleCoordinate
(that is, the one that corresponds to the maven artifact with the
same version, or the highest package matching a coordinate with +).null
if none was found.