Search in sources :

Example 1 with UsesSdk

use of org.robolectric.pluginapi.UsesSdk in project robolectric by robolectric.

the class DefaultSdkPicker method selectSdks.

/**
 * Enumerate the SDKs to be used for this test.
 *
 * @param configuration a collection of configuration objects, including {@link Config}
 * @param usesSdk the {@link UsesSdk} for the test
 * @return the list of candidate {@link Sdk}s.
 * @since 3.9
 */
@Override
@Nonnull
public List<Sdk> selectSdks(Configuration configuration, UsesSdk usesSdk) {
    Config config = configuration.get(Config.class);
    Set<Sdk> sdks = new TreeSet<>(configuredSdks(config, usesSdk));
    if (enabledSdks != null) {
        sdks = Sets.intersection(sdks, enabledSdks);
    }
    return Lists.newArrayList(sdks);
}
Also used : Config(org.robolectric.annotation.Config) TreeSet(java.util.TreeSet) UsesSdk(org.robolectric.pluginapi.UsesSdk) Sdk(org.robolectric.pluginapi.Sdk) Nonnull(javax.annotation.Nonnull)

Aggregations

TreeSet (java.util.TreeSet)1 Nonnull (javax.annotation.Nonnull)1 Config (org.robolectric.annotation.Config)1 Sdk (org.robolectric.pluginapi.Sdk)1 UsesSdk (org.robolectric.pluginapi.UsesSdk)1