aboutsummaryrefslogtreecommitdiff
path: root/buildSrc/src/main/groovy/org/robolectric/gradle/GradleManagedDevicePlugin.groovy
blob: cdcd3ca8365096d9d42c4c5d9899ec3c6e9661c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package org.robolectric.gradle

import com.android.build.api.dsl.ManagedVirtualDevice
import org.gradle.api.Plugin
import org.gradle.api.Project

class GradleManagedDevicePlugin implements Plugin<Project> {
    @Override
    void apply(Project project) {
        project.android.testOptions {
            animationsDisabled = true
            devices {
                // ./gradlew -Pandroid.sdk.channel=3 nexusOneApi29DebugAndroidTest
                nexusOneApi29(ManagedVirtualDevice) {
                    device = "Nexus One"
                    apiLevel = 29
                    systemImageSource = "aosp"
                }
                // ./gradlew -Pandroid.sdk.channel=3 nexusOneApi34DebugAndroidTest
                nexusOneApi34(ManagedVirtualDevice) {
                    device = "Nexus One"
                    apiLevel = 34
                    systemImageSource = "aosp"
                }
            }
        }
    }
}