Skip to content

Commit

Permalink
Update: Dependencies to latest versions (#107)
Browse files Browse the repository at this point in the history
This includes AGP update to version 8.6
  • Loading branch information
Rolf-Smit authored Sep 2, 2024
1 parent 92e1318 commit 7f6d0db
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 37 deletions.
28 changes: 14 additions & 14 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
[versions]
androidMinSdk = "19"
androidMinSdk = "21"
androidTargetSdk = "34"
androidCompileSdk = "34"
kotlin = "1.9.23"
androidGradlePlugin = "8.3.1"
androidGradlePlugin = "8.6.0"

[libraries]
appCompat = { module = "androidx.appcompat:appcompat", version = "1.6.1" }
appCompat = { module = "androidx.appcompat:appcompat", version = "1.7.0" }
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" }
truth = { module = "com.google.truth:truth", version = "1.4.2" }
supportTestRunner = { module = "androidx.test:runner", version = "1.5.2" }
testOrchestrator = { module = "androidx.test:orchestrator", version = "1.4.2" }
espressoCore = { module = "androidx.test.espresso:espresso-core", version = "3.5.1" }
androidJUnit = { module = "androidx.test.ext:junit", version = "1.1.5" }
commonsCsv = { module = "org.apache.commons:commons-csv", version = "1.10.0" }
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.11.0" }
kotlinTest = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
robolectric = { module = "org.robolectric:robolectric", version = "4.12.1" }
mockk = { module = "io.mockk:mockk", version = "1.13.10" }
jacksonYaml = { module = "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml", version = "2.17.0"}
jacksonKotlin = { module = "com.fasterxml.jackson.module:jackson-module-kotlin", version = "2.17.0"}
robolectric = { module = "org.robolectric:robolectric", version = "4.13" }
mockk = { module = "io.mockk:mockk", version = "1.13.12" }
jacksonYaml = { module = "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml", version = "2.17.2"}
jacksonKotlin = { module = "com.fasterxml.jackson.module:jackson-module-kotlin", version = "2.17.2"}

[bundles]
androidInstrumentedTest = ["supportTestRunner", "espressoCore", "androidJUnit"]
Expand All @@ -33,8 +33,8 @@ jvmTest = ["kotlinTest", "junit", "truth", "commonsCsv"]
kotlinJvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
kotlinAndroid = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlinDokka = { id = "org.jetbrains.dokka", version = "1.9.20" }
pluginPortalPublish = { id = "com.gradle.plugin-publish", version = "0.21.0" }
mavenPublish = { id = "com.vanniktech.maven.publish", version = "0.28.0" }
pluginPortalPublish = { id = "com.gradle.plugin-publish", version = "1.2.2" }
mavenPublish = { id = "com.vanniktech.maven.publish", version = "0.29.0" }
versionCheck = { id = "com.github.ben-manes.versions", version = "0.51.0" }
androidApp = { id = "com.android.application", version.ref = "androidGradlePlugin"}
androidLibrary = { id = "com.android.library", version.ref = "androidGradlePlugin"}
22 changes: 4 additions & 18 deletions plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,31 +50,17 @@ mavenPublishing {
}

gradlePlugin {
setWebsite(POM_URL)
setVcsUrl(POM_SCM_URL)
plugins {
rootCoverage {
id = 'nl.neotech.plugin.rootcoverage'
implementationClass = 'org.neotech.plugin.rootcoverage.RootCoveragePlugin'
}
}
}

pluginBundle {
setWebsite(POM_URL)
vcsUrl = POM_SCM_URL
setDescription(POM_DESCRIPTION)
tags = ['android', 'coverage', 'jacoco', 'code-coverage', 'coverage-report', 'aggregated-report']

plugins {
rootCoverage {
displayName = 'Android-Root-Coverage-Plugin'
description = POM_DESCRIPTION
tags.set(['android', 'coverage', 'jacoco', 'code-coverage', 'coverage-report', 'aggregated-report'])
}
}

mavenCoordinates {
groupId = GROUP
artifactId = POM_ARTIFACT_ID
version = VERSION_NAME
}
}

test {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.neotech.plugin.rootcoverage

import org.gradle.api.Project
import org.neotech.plugin.rootcoverage.utilities.getReportOutputDir
import org.neotech.plugin.rootcoverage.utilities.getReportOutputFile

private const val JACOCO_PLUGIN_NAME = "jacoco"
Expand Down Expand Up @@ -30,7 +31,7 @@ internal fun Project.createJacocoReportTask(
task.group = taskGroup
task.description = taskDescription
task.reports.apply {
html.outputLocation.set(getReportOutputFile("jacoco"))
html.outputLocation.set(getReportOutputDir("jacoco"))
xml.outputLocation.set(getReportOutputFile("jacoco.xml"))
csv.outputLocation.set(getReportOutputFile("jacoco.csv"))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ 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.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 @@ -164,7 +166,6 @@ class RootCoveragePlugin : Plugin<Project> {

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


val taskProvider = variant.artifacts.forScope(ScopedArtifacts.Scope.PROJECT).use(
project.tasks.named(this.name) as TaskProvider<CustomJacocoReportTask>
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
package org.neotech.plugin.rootcoverage.utilities

import org.gradle.api.Project
import org.gradle.api.file.Directory
import org.gradle.api.file.RegularFile
import org.gradle.api.provider.Provider
import java.io.File

/**
* Returns the output report path composed from the given [fileName] as a [File].
* Returns the output report file composed from the given [fileName] as a [RegularFile].
*/
internal fun Project.getReportOutputFile(fileName: String): File = file("$buildDir/reports/$fileName")
internal fun Project.getReportOutputFile(fileName: String): Provider<RegularFile> =
layout.buildDirectory.file("reports/$fileName")

/**
* Returns the output report path composed from the given [directory] as a [Directory].
*/
internal fun Project.getReportOutputDir(directory: String): Provider<Directory> =
layout.buildDirectory.dir("reports/$directory")
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ class IntegrationTest(

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

val gradleVersions = arrayOf("8.4")
val gradleVersions = arrayOf("8.7", "8.10")

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

0 comments on commit 7f6d0db

Please sign in to comment.