Skip to content

Latest commit

 

History

History
44 lines (32 loc) · 1.09 KB

robolectric_test_module.md

File metadata and controls

44 lines (32 loc) · 1.09 KB

Back to Index

gradle-android-test-plugin

Move some of the robolectric supported tests into an own module to separate simple units from component tests.

For Robolectric basics see also Robolectrc

avoid release builds for test runs, and conflict between lint and test runs

** check if issue is gone**

afterEvaluate {

    def isLintRun = false
    def isTestRun = false

    gradle.startParameter.taskNames.each {
        if (it.contains("lint")) {
            isLintRun = true
        }
        if (it.contains("test")) {
            isTestRun = true
        }
    }

    if (isLintRun && isTestRun) {
        println "WARNING: tests for release type are disabled for supporting jacoco"
        println "WARNING: run test and lint at same time is not supported"
        exit 1
    }

    if (isTestRun) {
        tasks.each {
            if (it.name.contains("Release")) {
                it.enabled = false
            }
        }
    }
}

Back to Index