Skip to content

Commit

Permalink
Release 0.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
shanshin committed Oct 3, 2022
1 parent 8734c77 commit 24a0188
Show file tree
Hide file tree
Showing 8 changed files with 167 additions and 103 deletions.
25 changes: 25 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,28 @@
0.6.1 / 2022-10-03
===================

### Features
* Implemented filtering of reports by annotation (#121)
* Minimal and default agent versions upgraded to `1.0.683`

### Bugfixes
* Added filtering out projects without a build file (#222)
* Added JaCoCo reports filtering (#220)
* Fixed coverage for function reference (#148)
* Fixed incorrect multiplatform lookup adapter (#193)
* Fixed `ArrayIndexOutOfBoundsException` during class instrumentation (#166)

### Internal features
* Upgraded Gradle version to `7.5.1`
* Rewritten functional tests infrastructure
* Added example projects
* XML and HTML report generation moved to Kover Aggregator

### Documentation
* Added contribution guide
* Added section `Building and contributing` into Table of contents
* Fix migration to `0.6.0` documentation

0.6.0 / 2022-08-23
===================
Note that this is a full changelog relative to `0.6.0` version. Changelog relative to `0.6.0-Beta` can be found at the end of the changelog.
Expand Down
229 changes: 134 additions & 95 deletions README.md
Expand Up @@ -23,6 +23,7 @@ Minimal supported `Gradle` version: `6.6`.
- [Specifying Coverage Engine](#specifying-coverage-engine)
- [Kover single-project tasks](#kover-single-project-tasks)
- [Kover merged tasks](#kover-merged-tasks)
- [Example of configuring Android application](#example-of-configuring-android-application)
- [Implicit plugin dependencies](#implicit-plugin-dependencies)
- [Building and contributing](#building-and-contributing)

Expand All @@ -44,7 +45,7 @@ In top-level build file:

```kotlin
plugins {
id("org.jetbrains.kotlinx.kover") version "0.6.0"
id("org.jetbrains.kotlinx.kover") version "0.6.1"
}
```
</details>
Expand All @@ -54,7 +55,7 @@ plugins {

```groovy
plugins {
id 'org.jetbrains.kotlinx.kover' version '0.6.0'
id 'org.jetbrains.kotlinx.kover' version '0.6.1'
}
```
</details>
Expand All @@ -72,7 +73,7 @@ buildscript {
}

dependencies {
classpath("org.jetbrains.kotlinx:kover:0.6.0")
classpath("org.jetbrains.kotlinx:kover:0.6.1")
}
}

Expand All @@ -89,7 +90,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'org.jetbrains.kotlinx:kover:0.6.0'
classpath 'org.jetbrains.kotlinx:kover:0.6.1'
}
}
Expand Down Expand Up @@ -158,118 +159,54 @@ tasks.test {
```
</details>

**For other platforms (like Kotlin-Multiplatform), the names may differ and you may also have several test tasks, so you first need to determine the name of the required task.**


### Configuring Android test task
**For other platforms (like Android or Kotlin-Multiplatform), the names may differ and you may also have several test tasks, so you first need to determine the name of the required task.**

Example of configuring test task for build type `debug` in Android:
<details open>
<summary>Kotlin</summary>

`build.gradle.kts` (Project)
```kotlin
buildscript {
// ...
dependencies {
// ...
classpath("org.jetbrains.kotlinx:kover:0.6.0")
}
}

plugins {
id("org.jetbrains.kotlinx.kover") version "0.6.0"
}

koverMerged {
enable()

filters {
classes {
excludes.addAll(
listOf(
"*Fragment",
"*Fragment\$*",
"*Activity",
"*Activity\$*",
"*.databinding.*", // ViewBinding
"org.jetbrains.kover_android_kts_example.BuildConfig"
)
)
}
}
}
```

`build.gradle.kts` (Module)
```kotlin
plugins {
// ...
id("org.jetbrains.kotlinx.kover")
}

android {
// ...
}

dependencies {
// ...
}

kover {
instrumentation {
excludeTasks.add "testReleaseUnitTest"
// other Android declarations

testOptions {
unitTests.all {
if (it.name == "testDebugUnitTest") {
it.extensions.configure(kotlinx.kover.api.KoverTaskExtension::class) {
isDisabled.set(false) // true to disable instrumentation tests of this task, Kover reports will not depend on the results of their execution
binaryReportFile.set(file("$buildDir/custom/debug-report.bin")) // set file name of binary report
includes = listOf("com.example.*") // see "Instrumentation inclusion rules" below
excludes = listOf("com.example.subpackage.*") // see "Instrumentation exclusion rules" below
}
}
}
}
}
```

An example is available here: https://github.com/Kotlin/kotlinx-kover/tree/main/examples/android_kts
</details>

<details>
<summary>Groovy</summary>

`build.gradle` (Project)
```groovy
plugin {
// ...
id 'org.jetbrains.kotlinx.kover' version "0.6.0"
}
koverMerged {
enable()
filters {
classes {
excludes.add "*.databinding.*" // ViewBinding
}
}
}
```

`build.gradle` (Module)
```groovy
plugins {
// ...
id 'org.jetbrains.kotlinx.kover'
}
android {
// ...
}
dependencies {
// ...
}
kover {
instrumentation {
excludeTasks.add "testReleaseUnitTest"
// other Android declarations
testOptions {
unitTests.all {
if (name == "testDebugUnitTest") {
kover {
disabled = false // true to disable instrumentation tests of this task, Kover reports will not depend on the results of their execution
binaryReportFile.set(file("$buildDir/custom/debug-report.bin")) // set file name of binary report
includes = ['com.example.*'] // see "Instrumentation inclusion rules" below
excludes = ['com.example.subpackage.*'] // see "Instrumentation exclusion rules" below
}
}
}
}
}
```

An example is available here: https://github.com/Kotlin/kotlinx-kover/tree/main/examples/android_groovy
</details>


Expand Down Expand Up @@ -668,6 +605,108 @@ Tasks that are created for project where the Kover plugin is applied and merged
- `koverMergedReport` - Executes both `koverMergedXmlReport` and `koverMergedHtmlReport` tasks.
- `koverMergedVerify` - Verifies code coverage metrics of all projects based on specified rules. Always executes before `check` task.

### Example of configuring Android application

Example of configuring test task for build type `debug` in Android:
<details open>
<summary>Kotlin</summary>

`build.gradle.kts` (Project)
```kotlin
buildscript {
// ...
dependencies {
// ...
classpath("org.jetbrains.kotlinx:kover:0.6.1")
}
}

plugins {
id("org.jetbrains.kotlinx.kover") version "0.6.1"
}

koverMerged {
enable()

filters {
classes {
excludes += "*.databinding.*" // exclude classes by mask
}
}
}
```

`build.gradle.kts` (Module)
```kotlin
plugins {
// ...
id("org.jetbrains.kotlinx.kover")
}

android {
// ...
}

dependencies {
// ...
}

kover {
instrumentation {
excludeTasks += "testReleaseUnitTest" // exclude testReleaseUnitTest from instrumentation
}
}
```

An example is available [here](examples/android_kts)
</details>

<details>
<summary>Groovy</summary>

`build.gradle` (Project)
```groovy
plugin {
// ...
id 'org.jetbrains.kotlinx.kover' version "0.6.1"
}
koverMerged {
enable()
filters {
classes {
excludes.add "*.databinding.*" // exclude classes by mask
}
}
}
```

`build.gradle` (Module)
```groovy
plugins {
// ...
id 'org.jetbrains.kotlinx.kover'
}
android {
// ...
}
dependencies {
// ...
}
kover {
instrumentation {
excludeTasks.add "testReleaseUnitTest" // exclude testReleaseUnitTest from instrumentation
}
}
```

An example is available [here](examples/android_groovy)

</details>

## Implicit plugin dependencies
While the plugin is being applied, the artifacts of the JaCoCo or IntelliJ toolkit are dynamically loaded. They are downloaded from the `mavenCentral` repository.
Expand Down
4 changes: 2 additions & 2 deletions examples/android_groovy/build.gradle
@@ -1,7 +1,7 @@
plugins {
id 'com.android.application' version '7.2.2' apply false
id 'org.jetbrains.kotlin.android' version '1.7.10' apply false
id 'org.jetbrains.kotlinx.kover' version "0.6.0"
id 'org.jetbrains.kotlinx.kover' version "0.6.1"
}

task clean(type: Delete) {
Expand All @@ -23,4 +23,4 @@ koverMerged {
)
}
}
}
}
2 changes: 1 addition & 1 deletion examples/android_kts/buildSrc/src/main/java/Versions.kt
Expand Up @@ -8,5 +8,5 @@ object Versions {

const val ANDROID_GRADLE_PLUGIN = "7.2.2"
const val KOTLIN = "1.7.10"
const val KOVER = "0.6.0"
const val KOVER = "0.6.1"
}
2 changes: 1 addition & 1 deletion examples/defaults/build.gradle.kts
@@ -1,6 +1,6 @@
plugins {
kotlin("jvm") version "1.7.10"
id("org.jetbrains.kotlinx.kover") version "0.6.0"
id("org.jetbrains.kotlinx.kover") version "0.6.1"
}

repositories {
Expand Down
2 changes: 1 addition & 1 deletion examples/merged/build.gradle.kts
@@ -1,6 +1,6 @@
plugins {
kotlin("jvm") version "1.7.10"
id("org.jetbrains.kotlinx.kover") version "0.6.0"
id("org.jetbrains.kotlinx.kover") version "0.6.1"
}

repositories {
Expand Down
2 changes: 1 addition & 1 deletion examples/minimal/build.gradle.kts
@@ -1,6 +1,6 @@
plugins {
kotlin("jvm") version "1.7.10"
id("org.jetbrains.kotlinx.kover") version "0.6.0"
id("org.jetbrains.kotlinx.kover") version "0.6.1"
}

repositories {
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
@@ -1,7 +1,7 @@
version=0.6.1-SNAPSHOT
version=0.6.2-SNAPSHOT
group=org.jetbrains.kotlinx

# version of the latest release
recentVersion=0.6.0
recentVersion=0.6.1
kotlinVersion=1.7.10
kotlin.code.style=official

0 comments on commit 24a0188

Please sign in to comment.