Skip to content

Commit

Permalink
chore: Use snapshot jacoco version (#220)
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszkwiecinski authored May 1, 2021
1 parent d9f6f68 commit a129a89
Show file tree
Hide file tree
Showing 13 changed files with 36 additions and 51 deletions.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Changed
- Require using Kotlin 1.4 for all library consumers. Bump min supported Gradle version to 6.8.3
- Update Kotlin plugin to [1.5.0](https://github.com/JetBrains/kotlin/releases/tag/v1.5.0)
- Update Jacoco version to `0.8.7-SNAPSHOT` to [support Kotlin 1.5](https://github.com/detekt/detekt/pull/3718/files)

## [0.25.0] - 2021-04-15
## Added
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ dependencies {
testImplementation project(":testing")
}

tasks.withType(Test) {
tasks.withType(Test).configureEach {
useJUnitPlatform()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@ import com.project.starter.modules.internal.daggerCoverageExclusions
import org.gradle.api.DomainObjectSet
import org.gradle.api.Project
import org.gradle.api.tasks.testing.Test
import org.gradle.testing.jacoco.plugins.JacocoPluginExtension
import org.gradle.testing.jacoco.plugins.JacocoTaskExtension
import org.gradle.testing.jacoco.tasks.JacocoReport

internal fun Project.configureAndroidCoverage(variants: DomainObjectSet<out BaseVariant>, projectExclusions: List<String>) {
pluginManager.apply("jacoco")

tasks.withType(Test::class.java) {
extensions.configure(JacocoPluginExtension::class.java) {
it.toolVersion = "0.8.7-SNAPSHOT"
}
tasks.withType(Test::class.java).configureEach {
it.extensions.getByType(JacocoTaskExtension::class.java).apply {
isIncludeNoLocationClasses = true
excludes = listOf("jdk.internal.*")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ internal class AndroidQualityPluginTest : WithGradleProjectTest() {
repositories {
google()
jcenter()
mavenCentral()
}
android {
Expand Down
7 changes: 4 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ commonConfig {
allprojects {
tasks.withType(KotlinCompile).configureEach {
kotlinOptions {
apiVersion = "1.4"
languageVersion = "1.4"
useIR = true
}
}
configurations.configureEach {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
resolutionStrategy.eachDependency {
if (requested.group == 'org.jetbrains.kotlin' && requested.name.startsWith("kotlin")) {
details.useVersion "1.5.0"
useVersion "1.5.0"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ internal fun Project.configureKotlinCoverage() {
}
}
extensions.configure(JacocoPluginExtension::class.java) {
it.toolVersion = "0.8.6"
it.toolVersion = "0.8.7-SNAPSHOT"
}
tasks.named("jacocoTestReport", JacocoReport::class.java) {
it.dependsOn(":$path:test")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,24 @@ package com.project.starter.modules.internal
import org.gradle.api.Project

internal fun Project.configureRepositories(): Unit = with(repositories) {
google { repository ->
repository.mavenContent { content ->
exclusiveContent { content ->
content.forRepository { google() }
content.filter {
val googleLibraries = listOf(
"com\\.android.*",
"androidx.*",
"android.arch.*",
"com\\.google.*"
"androidx\\..*",
"android\\.arch\\..*",
"com\\.google\\.android\\..*",
"com\\.google\\.gms",
)
googleLibraries.forEach(content::includeGroupByRegex)
googleLibraries.forEach(it::includeGroupByRegex)
}
}
mavenCentral()
@Suppress("DEPRECATION")
jcenter { repository ->
repository.mavenContent { content ->
content.includeGroup("org.jetbrains.trove4j")
content.includeGroup("org.jetbrains.kotlinx")
exclusiveContent { content ->
content.forRepository {
maven { it.setUrl("https://oss.sonatype.org/content/repositories/snapshots") }
}
content.filter { it.includeGroup("org.jacoco") }
}
mavenCentral()
}
5 changes: 1 addition & 4 deletions multiplatform/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id 'java-gradle-plugin'
id 'com.starter.library.kotlin'
id 'pl.droidsonroids.jacoco.testkit' version '1.0.7'
id 'pl.droidsonroids.jacoco.testkit' version '1.0.8'
id 'com.starter.publishing'
}

Expand All @@ -18,9 +18,6 @@ dependencies {
testImplementation project(":testing")
}

jacoco {
toolVersion = "0.8.6"
}
test {
useJUnitPlatform()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ import org.gradle.testing.jacoco.tasks.JacocoReport
internal fun Project.configureMultiplatformCoverage() {
pluginManager.apply("jacoco")

tasks.withType(Test::class.java) {
tasks.withType(Test::class.java).configureEach {
it.extensions.getByType<JacocoTaskExtension>().apply {
isIncludeNoLocationClasses = true
excludes = listOf("jdk.internal.*")
}
}

extensions.configure(JacocoPluginExtension::class.java) {
it.toolVersion = "0.8.6"
it.toolVersion = "0.8.7-SNAPSHOT"
}
tasks.register("jacocoTestReport", JacocoReport::class.java) {
it.dependsOn(":$path:jvmTest")
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@ internal fun Project.configureDetekt() {
tasks.named(ProjectCodeStyleTask.TASK_NAME) {
it.dependsOn("$path:detekt")
}
tasks.withType(Detekt::class.java) {
tasks.withType(Detekt::class.java).configureEach {
it.jvmTarget = rootConfig.javaVersion.toString()
}

// https://github.com/detekt/detekt/issues/3712
configurations.named("detekt") {
it.resolutionStrategy.force("org.jetbrains.kotlinx:kotlinx-html-jvm:0.7.3")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ class QualityPlugin : Plugin<Project> {

override fun apply(project: Project) = with(project) {
repositories.mavenCentral()
repositories.exclusiveContent {
it.forRepositories(repositories.jcenter())
it.filter {
it.includeModule("org.jetbrains.kotlinx", "kotlinx-html-jvm")
}
}
addProjectCodeStyleTask()
configureKtlint()
configureDetekt()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ internal class QualityPluginTest : WithGradleProjectTest() {
id('org.jetbrains.kotlin.jvm')
}
repositories.jcenter()
repositories.mavenCentral()
""".trimIndent()
)
}
Expand Down

0 comments on commit a129a89

Please sign in to comment.