Skip to content

Commit 7f6d0db

Browse files
authored
Update: Dependencies to latest versions (#107)
This includes AGP update to version 8.6
1 parent 92e1318 commit 7f6d0db

File tree

6 files changed

+35
-37
lines changed

6 files changed

+35
-37
lines changed

gradle/libs.versions.toml

+14-14
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
[versions]
2-
androidMinSdk = "19"
2+
androidMinSdk = "21"
33
androidTargetSdk = "34"
44
androidCompileSdk = "34"
55
kotlin = "1.9.23"
6-
androidGradlePlugin = "8.3.1"
6+
androidGradlePlugin = "8.6.0"
77

88
[libraries]
9-
appCompat = { module = "androidx.appcompat:appcompat", version = "1.6.1" }
9+
appCompat = { module = "androidx.appcompat:appcompat", version = "1.7.0" }
1010
androidGradlePlugin = { module = "com.android.tools.build:gradle", version.ref = "androidGradlePlugin" }
1111
androidGradlePluginApi = { module = "com.android.tools.build:gradle-api", version.ref = "androidGradlePlugin" }
1212

1313
# Test dependencies
1414
junit = { module = "junit:junit", version = "4.13.2" }
15-
truth = { module = "com.google.truth:truth", version = "1.4.2" }
16-
supportTestRunner = { module = "androidx.test:runner", version = "1.5.2" }
1715
testOrchestrator = { module = "androidx.test:orchestrator", version = "1.4.2" }
18-
espressoCore = { module = "androidx.test.espresso:espresso-core", version = "3.5.1" }
19-
androidJUnit = { module = "androidx.test.ext:junit", version = "1.1.5" }
20-
commonsCsv = { module = "org.apache.commons:commons-csv", version = "1.10.0" }
16+
truth = { module = "com.google.truth:truth", version = "1.4.4" }
17+
supportTestRunner = { module = "androidx.test:runner", version = "1.6.2" }
18+
espressoCore = { module = "androidx.test.espresso:espresso-core", version = "3.6.1" }
19+
androidJUnit = { module = "androidx.test.ext:junit", version = "1.2.1" }
20+
commonsCsv = { module = "org.apache.commons:commons-csv", version = "1.11.0" }
2121
kotlinTest = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
22-
robolectric = { module = "org.robolectric:robolectric", version = "4.12.1" }
23-
mockk = { module = "io.mockk:mockk", version = "1.13.10" }
24-
jacksonYaml = { module = "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml", version = "2.17.0"}
25-
jacksonKotlin = { module = "com.fasterxml.jackson.module:jackson-module-kotlin", version = "2.17.0"}
22+
robolectric = { module = "org.robolectric:robolectric", version = "4.13" }
23+
mockk = { module = "io.mockk:mockk", version = "1.13.12" }
24+
jacksonYaml = { module = "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml", version = "2.17.2"}
25+
jacksonKotlin = { module = "com.fasterxml.jackson.module:jackson-module-kotlin", version = "2.17.2"}
2626

2727
[bundles]
2828
androidInstrumentedTest = ["supportTestRunner", "espressoCore", "androidJUnit"]
@@ -33,8 +33,8 @@ jvmTest = ["kotlinTest", "junit", "truth", "commonsCsv"]
3333
kotlinJvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
3434
kotlinAndroid = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
3535
kotlinDokka = { id = "org.jetbrains.dokka", version = "1.9.20" }
36-
pluginPortalPublish = { id = "com.gradle.plugin-publish", version = "0.21.0" }
37-
mavenPublish = { id = "com.vanniktech.maven.publish", version = "0.28.0" }
36+
pluginPortalPublish = { id = "com.gradle.plugin-publish", version = "1.2.2" }
37+
mavenPublish = { id = "com.vanniktech.maven.publish", version = "0.29.0" }
3838
versionCheck = { id = "com.github.ben-manes.versions", version = "0.51.0" }
3939
androidApp = { id = "com.android.application", version.ref = "androidGradlePlugin"}
4040
androidLibrary = { id = "com.android.library", version.ref = "androidGradlePlugin"}

plugin/build.gradle

+4-18
Original file line numberDiff line numberDiff line change
@@ -50,31 +50,17 @@ mavenPublishing {
5050
}
5151

5252
gradlePlugin {
53+
setWebsite(POM_URL)
54+
setVcsUrl(POM_SCM_URL)
5355
plugins {
5456
rootCoverage {
5557
id = 'nl.neotech.plugin.rootcoverage'
5658
implementationClass = 'org.neotech.plugin.rootcoverage.RootCoveragePlugin'
57-
}
58-
}
59-
}
60-
61-
pluginBundle {
62-
setWebsite(POM_URL)
63-
vcsUrl = POM_SCM_URL
64-
setDescription(POM_DESCRIPTION)
65-
tags = ['android', 'coverage', 'jacoco', 'code-coverage', 'coverage-report', 'aggregated-report']
66-
67-
plugins {
68-
rootCoverage {
6959
displayName = 'Android-Root-Coverage-Plugin'
60+
description = POM_DESCRIPTION
61+
tags.set(['android', 'coverage', 'jacoco', 'code-coverage', 'coverage-report', 'aggregated-report'])
7062
}
7163
}
72-
73-
mavenCoordinates {
74-
groupId = GROUP
75-
artifactId = POM_ARTIFACT_ID
76-
version = VERSION_NAME
77-
}
7864
}
7965

8066
test {

plugin/src/main/kotlin/org/neotech/plugin/rootcoverage/JacocoTaskFactory.kt

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package org.neotech.plugin.rootcoverage
22

33
import org.gradle.api.Project
4+
import org.neotech.plugin.rootcoverage.utilities.getReportOutputDir
45
import org.neotech.plugin.rootcoverage.utilities.getReportOutputFile
56

67
private const val JACOCO_PLUGIN_NAME = "jacoco"
@@ -30,7 +31,7 @@ internal fun Project.createJacocoReportTask(
3031
task.group = taskGroup
3132
task.description = taskDescription
3233
task.reports.apply {
33-
html.outputLocation.set(getReportOutputFile("jacoco"))
34+
html.outputLocation.set(getReportOutputDir("jacoco"))
3435
xml.outputLocation.set(getReportOutputFile("jacoco.xml"))
3536
csv.outputLocation.set(getReportOutputFile("jacoco.csv"))
3637
}

plugin/src/main/kotlin/org/neotech/plugin/rootcoverage/RootCoveragePlugin.kt

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@ import com.android.build.api.artifact.ScopedArtifact
55
import com.android.build.api.dsl.BuildType
66
import com.android.build.api.variant.AndroidComponentsExtension
77
import com.android.build.api.variant.ScopedArtifacts
8+
import com.android.build.api.variant.ScopedArtifactsOperation
89
import com.android.build.api.variant.Variant
910
import com.android.build.gradle.BaseExtension
1011
import org.gradle.api.GradleException
1112
import org.gradle.api.NamedDomainObjectContainer
1213
import org.gradle.api.Plugin
1314
import org.gradle.api.Project
1415
import org.gradle.api.Task
16+
import org.gradle.api.file.RegularFile
1517
import org.gradle.api.tasks.TaskProvider
1618
import org.gradle.api.tasks.testing.Test
1719
import org.gradle.testing.jacoco.plugins.JacocoPlugin
@@ -164,7 +166,6 @@ class RootCoveragePlugin : Plugin<Project> {
164166

165167
sourceDirectories.from(variant.sources.java?.all)
166168

167-
168169
val taskProvider = variant.artifacts.forScope(ScopedArtifacts.Scope.PROJECT).use(
169170
project.tasks.named(this.name) as TaskProvider<CustomJacocoReportTask>
170171
)
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
11
package org.neotech.plugin.rootcoverage.utilities
22

33
import org.gradle.api.Project
4+
import org.gradle.api.file.Directory
5+
import org.gradle.api.file.RegularFile
6+
import org.gradle.api.provider.Provider
47
import java.io.File
58

69
/**
7-
* Returns the output report path composed from the given [fileName] as a [File].
10+
* Returns the output report file composed from the given [fileName] as a [RegularFile].
811
*/
9-
internal fun Project.getReportOutputFile(fileName: String): File = file("$buildDir/reports/$fileName")
12+
internal fun Project.getReportOutputFile(fileName: String): Provider<RegularFile> =
13+
layout.buildDirectory.file("reports/$fileName")
14+
15+
/**
16+
* Returns the output report path composed from the given [directory] as a [Directory].
17+
*/
18+
internal fun Project.getReportOutputDir(directory: String): Provider<Directory> =
19+
layout.buildDirectory.dir("reports/$directory")

plugin/src/test/kotlin/org/neotech/plugin/rootcoverage/IntegrationTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ class IntegrationTest(
230230

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

233-
val gradleVersions = arrayOf("8.4")
233+
val gradleVersions = arrayOf("8.7", "8.10")
234234

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

0 commit comments

Comments
 (0)