From 8cd58a813604d88a31788a9bc5575d7de9237522 Mon Sep 17 00:00:00 2001 From: MohitMaliFtechiz Date: Thu, 15 Aug 2024 16:36:34 +0530 Subject: [PATCH] Improved the tasks according to the new gradle. --- buildSrc/src/main/kotlin/plugin/AllProjectConfigurer.kt | 2 +- jacoco.gradle | 5 +++-- lintConfig.xml | 2 +- team-props/git-hooks.gradle | 4 +++- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/buildSrc/src/main/kotlin/plugin/AllProjectConfigurer.kt b/buildSrc/src/main/kotlin/plugin/AllProjectConfigurer.kt index bc39d0d23a..6225add444 100644 --- a/buildSrc/src/main/kotlin/plugin/AllProjectConfigurer.kt +++ b/buildSrc/src/main/kotlin/plugin/AllProjectConfigurer.kt @@ -64,7 +64,7 @@ class AllProjectConfigurer { buildTypes { getByName("debug") { - isTestCoverageEnabled = false + isTestCoverageEnabled = true multiDexEnabled = true } } diff --git a/jacoco.gradle b/jacoco.gradle index 6b421ac2cf..d793987aad 100644 --- a/jacoco.gradle +++ b/jacoco.gradle @@ -22,11 +22,12 @@ jacoco { toolVersion = "0.8.12" } -tasks.withType(Test) { +tasks.withType(Test).configureEach { jacoco.includeNoLocationClasses = true } -task jacocoInstrumentationTestReport(type: JacocoReport, dependsOn: ['createDebugCoverageReport']) { +tasks.register('jacocoInstrumentationTestReport', JacocoReport) { + dependsOn = ['createDebugCoverageReport'] group "Reporting" description "Generate Jacoco coverage reports." reports { diff --git a/lintConfig.xml b/lintConfig.xml index 6158db5967..fd8ecfffea 100644 --- a/lintConfig.xml +++ b/lintConfig.xml @@ -35,7 +35,7 @@ - + diff --git a/team-props/git-hooks.gradle b/team-props/git-hooks.gradle index 1c80c43f65..878591bc4d 100644 --- a/team-props/git-hooks.gradle +++ b/team-props/git-hooks.gradle @@ -28,5 +28,7 @@ task installGitHooks(type: Exec) { } afterEvaluate { - tasks['preBuild'].dependsOn installGitHooks + tasks.named('preBuild').configure { + dependsOn installGitHooks + } }