Trying to set code coverage.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
aminecmi 2022-12-12 22:26:12 +01:00
parent 49f5848e7b
commit 4fce19bad4
4 changed files with 19 additions and 2 deletions

View File

@ -11,7 +11,7 @@ steps:
- mkdir -p ~/.gradle && echo "org.gradle.daemon=false\nignoreGitVersion=true\npushCache=false\nsystemProp.org.gradle.internal.http.connectionTimeout=180000\nsystemProp.org.gradle.internal.http.socketTimeout=180000" >> ~/.gradle/gradle.properties - mkdir -p ~/.gradle && echo "org.gradle.daemon=false\nignoreGitVersion=true\npushCache=false\nsystemProp.org.gradle.internal.http.connectionTimeout=180000\nsystemProp.org.gradle.internal.http.socketTimeout=180000" >> ~/.gradle/gradle.properties
- echo "---------------------------------------------------------" - echo "---------------------------------------------------------"
- echo "Analysing..." - echo "Analysing..."
- ./gradlew sonarqube -Dsonar.projectKey=RFS2 -Dsonar.host.url=$SONAR_HOST_URL -Dsonar.login=$SONAR_LOGIN - ./gradlew koverMergedXmlReport && ./gradlew sonarqube -Dsonar.projectKey=RFS2 -Dsonar.host.url=$SONAR_HOST_URL -Dsonar.login=$SONAR_LOGIN
- echo "---------------------------------------------------------" - echo "---------------------------------------------------------"
- echo "Building..." - echo "Building..."
- ./gradlew build -x test - ./gradlew build -x test

View File

@ -8,6 +8,7 @@ plugins {
kotlin("android") kotlin("android")
kotlin("kapt") kotlin("kapt")
id("com.mikepenz.aboutlibraries.plugin") id("com.mikepenz.aboutlibraries.plugin")
id("org.jetbrains.kotlinx.kover") version "0.6.1"
} }
fun Project.execWithOutput(cmd: String, ignore: Boolean = false): String { fun Project.execWithOutput(cmd: String, ignore: Boolean = false): String {

View File

@ -11,8 +11,9 @@ plugins {
id("com.android.library").version("7.3.1").apply(false) id("com.android.library").version("7.3.1").apply(false)
kotlin("android").version("1.7.20").apply(false) kotlin("android").version("1.7.20").apply(false)
kotlin("multiplatform").version("1.7.20").apply(false) kotlin("multiplatform").version("1.7.20").apply(false)
id("org.sonarqube").version("3.4.0.2513").apply(false) id("org.sonarqube").version("3.4.0.2513")
id("com.mikepenz.aboutlibraries.plugin").version("10.5.1").apply(false) id("com.mikepenz.aboutlibraries.plugin").version("10.5.1").apply(false)
id("org.jetbrains.kotlinx.kover") version "0.6.1"
} }
apply(plugin = "org.sonarqube") apply(plugin = "org.sonarqube")
@ -30,3 +31,17 @@ allprojects {
tasks.register("clean", Delete::class) { tasks.register("clean", Delete::class) {
delete(rootProject.buildDir) delete(rootProject.buildDir)
} }
sonarqube {
properties {
property("sonar.coverage.jacoco.xmlReportPaths", "${rootProject.buildDir}/reports/kover/merged/xml/report.xml")
}
}
project.tasks["sonarqube"].dependsOn "koverMergedXmlReport"
koverMerged {
enable()
}

View File

@ -10,6 +10,7 @@ plugins {
id("com.android.library") id("com.android.library")
id("com.squareup.sqldelight") id("com.squareup.sqldelight")
kotlin("plugin.serialization") version "1.4.10" kotlin("plugin.serialization") version "1.4.10"
id("org.jetbrains.kotlinx.kover") version "0.6.1"
} }
kotlin { kotlin {