diff --git a/affectedmoduledetector/build.gradle b/affectedmoduledetector/build.gradle index 427a9c20..8add6116 100644 --- a/affectedmoduledetector/build.gradle +++ b/affectedmoduledetector/build.gradle @@ -15,6 +15,10 @@ java { targetCompatibility = JavaVersion.VERSION_1_7 } +jacoco { + toolVersion = "0.8.7" +} + dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" testImplementation("junit:junit:4.13.2") diff --git a/affectedmoduledetector/src/test/kotlin/com/dropbox/affectedmoduledetector/AffectedModuleDetectorPluginTest.kt b/affectedmoduledetector/src/test/kotlin/com/dropbox/affectedmoduledetector/AffectedModuleDetectorPluginTest.kt index 272f7196..735b0358 100644 --- a/affectedmoduledetector/src/test/kotlin/com/dropbox/affectedmoduledetector/AffectedModuleDetectorPluginTest.kt +++ b/affectedmoduledetector/src/test/kotlin/com/dropbox/affectedmoduledetector/AffectedModuleDetectorPluginTest.kt @@ -1,13 +1,14 @@ package com.dropbox.affectedmoduledetector import com.google.common.truth.Truth.assertThat -import junit.framework.Assert.fail import org.gradle.api.Project +import org.gradle.api.internal.plugins.PluginApplicationException import org.gradle.testfixtures.ProjectBuilder import org.junit.Before import org.junit.Rule import org.junit.Test import org.junit.rules.TemporaryFolder +import java.lang.IllegalStateException class AffectedModuleDetectorPluginTest { @@ -39,8 +40,8 @@ class AffectedModuleDetectorPluginTest { try { // WHEN childProject.pluginManager.apply(AffectedModuleDetectorPlugin::class.java) - fail("Expected exception not thrown") - } catch (e: Exception) { + throw IllegalStateException("Expected to throw exception") + } catch (e: PluginApplicationException) { // THEN assertThat(e.message).isEqualTo("Failed to apply plugin [class 'com.dropbox.affectedmoduledetector.AffectedModuleDetectorPlugin']") } diff --git a/build.gradle b/build.gradle index d8e70f99..b4513d24 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = "1.4.10" + ext.kotlin_version = "1.5.31" repositories { google() jcenter()