Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[![Gradle Plugin Portal](https://img.shields.io/maven-metadata/v/https/plugins.gradle.org/m2/nl.neotech.plugin/android-root-coverage-plugin/maven-metadata.xml.svg?label=Gradle%20Plugin%20Portal)](https://plugins.gradle.org/plugin/nl.neotech.plugin.rootcoverage)
[![Maven Central](https://img.shields.io/maven-central/v/nl.neotech.plugin/android-root-coverage-plugin?label=Maven%20Central)](https://search.maven.org/artifact/nl.neotech.plugin/android-root-coverage-plugin)
[![Build](https://github.com/NeoTech-Software/Android-Root-Coverage-Plugin/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/NeoTech-Software/Android-Root-Coverage-Plugin/actions/workflows/build.yml)
[![Coverage](https://img.shields.io/codecov/c/gh/NeoTech-Software/Android-Root-Coverage-Plugin/branch/master?token=4I3MXF2WLX)](https://app.codecov.io/gh/NeoTech-Software/Android-Root-Coverage-Plugin/branch/master)
[![Coverage](https://img.shields.io/codecov/c/github/NeoTech-Software/Android-Root-Coverage-Plugin/master)](https://app.codecov.io/gh/NeoTech-Software/Android-Root-Coverage-Plugin/branch/master)

# Android-Root-Coverage-Plugin
**Automatically configures Jacoco code coverage tasks for both combined and per module coverage reports.**
Expand Down
28 changes: 14 additions & 14 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
[versions]
androidMinSdk = "21"
androidTargetSdk = "35"
androidCompileSdk = "35"
kotlin = "2.1.10"
androidGradlePlugin = "8.8.0"
androidCompileSdk = "36"
kotlin = "2.2.0"
androidGradlePlugin = "8.11.1"

[libraries]
appCompat = { module = "androidx.appcompat:appcompat", version = "1.7.0" }
appCompat = { module = "androidx.appcompat:appcompat", version = "1.7.1" }
androidGradlePlugin = { module = "com.android.tools.build:gradle", version.ref = "androidGradlePlugin" }
androidGradlePluginApi = { module = "com.android.tools.build:gradle-api", version.ref = "androidGradlePlugin" }

# Test dependencies
junit = { module = "junit:junit", version = "4.13.2" }
testOrchestrator = { module = "androidx.test:orchestrator", version = "1.4.2" }
testOrchestrator = { module = "androidx.test:orchestrator", version = "1.5.1" }
truth = { module = "com.google.truth:truth", version = "1.4.4" }
supportTestRunner = { module = "androidx.test:runner", version = "1.6.2" }
espressoCore = { module = "androidx.test.espresso:espresso-core", version = "3.6.1" }
androidJUnit = { module = "androidx.test.ext:junit", version = "1.2.1" }
commonsCsv = { module = "org.apache.commons:commons-csv", version = "1.13.0" }
commonsCsv = { module = "org.apache.commons:commons-csv", version = "1.14.0" }
kotlinTest = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
robolectric = { module = "org.robolectric:robolectric", version = "4.14.1" }
mockk = { module = "io.mockk:mockk", version = "1.13.16" }
jacksonYaml = { module = "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml", version = "2.18.2"}
jacksonKotlin = { module = "com.fasterxml.jackson.module:jackson-module-kotlin", version = "2.18.2"}
robolectric = { module = "org.robolectric:robolectric", version = "4.15.1" }
mockk = { module = "io.mockk:mockk", version = "1.14.5" }
jacksonYaml = { module = "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml", version = "2.19.2"}
jacksonKotlin = { module = "com.fasterxml.jackson.module:jackson-module-kotlin", version = "2.19.2"}

[bundles]
androidInstrumentedTest = ["supportTestRunner", "espressoCore", "androidJUnit"]
androidTest = ["androidJUnit", "robolectric"]
jvmTest = ["kotlinTest", "junit", "truth", "commonsCsv"]
androidInstrumentedTest = ["supportTestRunner", "espressoCore", "androidJUnit"]
androidTest = ["androidJUnit", "robolectric"]
jvmTest = ["kotlinTest", "junit", "truth", "commonsCsv"]

[plugins]
kotlinJvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
kotlinAndroid = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlinDokka = { id = "org.jetbrains.dokka", version = "2.0.0" }
pluginPortalPublish = { id = "com.gradle.plugin-publish", version = "1.3.1" }
mavenPublish = { id = "com.vanniktech.maven.publish", version = "0.30.0" }
mavenPublish = { id = "com.vanniktech.maven.publish", version = "0.34.0" }
versionCheck = { id = "com.github.ben-manes.versions", version = "0.52.0" }
androidApp = { id = "com.android.application", version.ref = "androidGradlePlugin"}
androidLibrary = { id = "com.android.library", version.ref = "androidGradlePlugin"}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
7 changes: 5 additions & 2 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand Down Expand Up @@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand Down Expand Up @@ -84,7 +86,8 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down
2 changes: 2 additions & 0 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem

@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
Expand Down
5 changes: 2 additions & 3 deletions plugin/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import com.vanniktech.maven.publish.SonatypeHost
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
Expand Down Expand Up @@ -44,7 +43,7 @@ jacocoTestReport {
}

mavenPublishing {
publishToMavenCentral(SonatypeHost.S01)
publishToMavenCentral()
signAllPublications()
}

Expand Down Expand Up @@ -105,7 +104,7 @@ pluginManager.withPlugin("jacoco") {
from {
zipTree(project.configurations.getByName(JacocoPlugin.AGENT_CONFIGURATION_NAME).asPath).matching { include 'jacocoagent.jar' }.singleFile
}
into file("${buildDir}/testkit")
into project.layout.buildDirectory.dir("testkit")
}

def javaTestTask = tasks.named(JavaPlugin.TEST_TASK_NAME)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,15 @@ package org.neotech.plugin.rootcoverage
import com.android.build.api.AndroidPluginVersion
import com.android.build.api.artifact.ScopedArtifact
import com.android.build.api.dsl.BuildType
import com.android.build.api.variant.AndroidComponentsExtension
import com.android.build.api.variant.ApplicationAndroidComponentsExtension
import com.android.build.api.variant.LibraryAndroidComponentsExtension
import com.android.build.api.variant.ScopedArtifacts
import com.android.build.api.variant.ScopedArtifactsOperation
import com.android.build.api.variant.Variant
import com.android.build.gradle.BaseExtension
import org.gradle.api.GradleException
import org.gradle.api.NamedDomainObjectContainer
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.file.RegularFile
import org.gradle.api.tasks.TaskProvider
import org.gradle.api.tasks.testing.Test
import org.gradle.testing.jacoco.plugins.JacocoPlugin
Expand Down Expand Up @@ -54,7 +52,6 @@ class RootCoveragePlugin : Plugin<Project> {
}
}


private fun createSubProjectCoverageTask(subProject: Project) {
val task = subProject.createJacocoReportTask(
taskName = "coverageReport",
Expand Down Expand Up @@ -117,7 +114,12 @@ class RootCoveragePlugin : Plugin<Project> {

private fun JacocoReport.addSubProjectInternal(subProject: Project) {
// Only Android modules are supported
val androidComponents = subProject.extensions.getByType(AndroidComponentsExtension::class.java)
val androidComponents = subProject.extensions.findByType(ApplicationAndroidComponentsExtension::class.java) ?: subProject.extensions.findByType(LibraryAndroidComponentsExtension::class.java)

if(androidComponents == null) {
throw GradleException("No application or library extension found on project: ${project.path}!")
}

androidComponents.assertMinimumRequiredAGPVersion(minimumRequiredAgpVersion)

// Get the exact required build variant for the current sub-project.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ class IntegrationTest(

val fixture = File("src/test/test-fixtures/multi-module")

val gradleVersions = arrayOf("8.10.2", "8.11.1", "8.12.1")
val gradleVersions = arrayOf("8.13", "8.14.3")

val configurations = File(fixture, "configurations").listFiles() ?: error("Configurations folder not found in $fixture")
return configurations.flatMap { configuration ->
Expand Down