@AutoService(value=DependencyResolver.class) @Priority(value=-2147483648) public class LegacyDependencyResolver extends Object implements DependencyResolver
Robolectric’s historical dependency resolver (which is currently still the default), which is used by DefaultSdkProvider
to locate SDK jars.
Robolectric will attempt to find SDK jars in the following order:
robolectric-deps.properties
is set, then Robolectric will look for a file with the specified path containing SDK references as described here
.robolectric.dependency.dir
is set, then Robolectric will look for SDK jars in the given directory with Maven artifact-style names (e.g. android-all-7.1.0_r7-robolectric-r1.jar
).robolectric.offline
is true
, then Robolectric will look for SDK jars in the current working directory with Maven artifact-style names.robolectric-deps.properties
is found on the classpath, then Robolectric will resolve SDKs with that file as described here
.If you require a hermetic build, we recommend either specifying the robolectric.dependency.dir
system property, or providing your own SdkProvider
.
Constructor and Description |
---|
LegacyDependencyResolver(Properties properties) |
Modifier and Type | Method and Description |
---|---|
URL |
getLocalArtifactUrl(DependencyJar dependency) |
URL[] |
getLocalArtifactUrls(DependencyJar dependency)
Returns URLs representing the full transitive dependency graph of the given Maven dependency.
|
@Inject public LegacyDependencyResolver(Properties properties)
public URL getLocalArtifactUrl(DependencyJar dependency)
getLocalArtifactUrl
in interface DependencyResolver
public URL[] getLocalArtifactUrls(DependencyJar dependency)
DependencyResolver
Returns URLs representing the full transitive dependency graph of the given Maven dependency.
getLocalArtifactUrls
in interface DependencyResolver