From 8a4a0c0f965e6d05c3c53bd13b12e5fffd1b4791 Mon Sep 17 00:00:00 2001 From: Gergely Hegedus Date: Mon, 26 Sep 2022 20:21:01 +0300 Subject: [PATCH] PR#124 Fix issue with merging meta-info --- app-shared-test/build.gradle | 3 +++ build.gradle | 3 ++- .../example-navcontroller-shared-test/build.gradle | 3 +++ gradlescripts/disable.test.task.gradle | 10 ++++++++++ 4 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 gradlescripts/disable.test.task.gradle 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