diff --git a/app-shared-test/build.gradle b/app-shared-test/build.gradle index c9a64d4..deeb0dc 100644 --- a/app-shared-test/build.gradle +++ b/app-shared-test/build.gradle @@ -35,6 +35,9 @@ android { } } +// since it itself contains the Test it doesn't have tests of it's own +disableTestTasks(this) + dependencies { implementation project(":app") implementation project(':test-util-android') diff --git a/build.gradle b/build.gradle index d055725..40d384d 100644 --- a/build.gradle +++ b/build.gradle @@ -45,4 +45,5 @@ apply from: 'gradlescripts/ktlint.gradle' apply from: 'gradlescripts/lint.gradle' apply from: 'gradlescripts/testoptions.gradle' apply from: 'gradlescripts/test.tasks.gradle' -apply from: 'gradlescripts/testdependencies.gradle' \ No newline at end of file +apply from: 'gradlescripts/testdependencies.gradle' +apply from: 'gradlescripts/disable.test.task.gradle' \ No newline at end of file diff --git a/examplecase/example-navcontroller-shared-test/build.gradle b/examplecase/example-navcontroller-shared-test/build.gradle index b05fb63..a33e5ad 100644 --- a/examplecase/example-navcontroller-shared-test/build.gradle +++ b/examplecase/example-navcontroller-shared-test/build.gradle @@ -34,6 +34,9 @@ android { } } +// since it itself contains the Test it doesn't have tests of it's own +disableTestTasks(this) + dependencies { applyAppSharedTestDependenciesTo(this) implementation project(":examplecase:example-navcontroller") diff --git a/gradlescripts/disable.test.task.gradle b/gradlescripts/disable.test.task.gradle new file mode 100644 index 0000000..5979e98 --- /dev/null +++ b/gradlescripts/disable.test.task.gradle @@ -0,0 +1,10 @@ +project.ext { + // helper function to disable Test Tasks in modules where there are no tests and so the Tests are not required. + disableTestTasks = { module -> + module.tasks.whenTaskAdded { task -> + if(task.name.contains("Test")) { + task.enabled = false + } + } + } +} \ No newline at end of file