Class LegacyDependencyResolver

java.lang.Object
org.robolectric.plugins.LegacyDependencyResolver
All Implemented Interfaces:
DependencyResolver

@AutoService(DependencyResolver.class) @Priority(-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:

  1. If the system property robolectric-deps.properties is set, then Robolectric will look for a file with the specified path containing SDK references as described here.
  2. If the system property 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).
  3. If the system property robolectric.offline is true, then Robolectric will look for SDK jars in the current working directory with Maven artifact-style names.
  4. If a resource file named robolectric-deps.properties is found on the classpath, then Robolectric will resolve SDKs with that file as described here.
  5. Otherwise the jars will be downloaded from Maven Central and cached locally.
If you require a hermetic build, we recommend either specifying the robolectric.dependency.dir system property, or providing your own SdkProvider.