Skip to content

Commit

Permalink
Fixed coverage reports
Browse files Browse the repository at this point in the history
  • Loading branch information
gmazzo committed Apr 25, 2023
1 parent d3abc5c commit e97f56c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
org.gradle.jvmargs=-Xmx1g
org.gradle.caching=true
1 change: 1 addition & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ mockk = { module = "io.mockk:mockk", version = "1.13.5" }
android = { id = "com.android.application", version = "7.4.2" }
gitVersioning = { id = "me.qoomon.git-versioning", version = "6.4.2" }
gradle-pluginPublish = { id = "com.gradle.plugin-publish", version = "1.2.0" }
jacoco-testkit = { id = "pl.droidsonroids.jacoco.testkit", version = "1.0.11" }
kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
2 changes: 1 addition & 1 deletion plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
alias(libs.plugins.kotlin)
alias(libs.plugins.gitVersioning)
alias(libs.plugins.gradle.pluginPublish)
jacoco
alias(libs.plugins.jacoco.testkit)
}

group = "com.github.gmazzo.buildconfig"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,11 @@ class BuildConfigPluginTest {
}
}

// This allows to coverage data to be collected from GradleRunner instance
// https://github.com/koral--/jacoco-gradle-testkit-plugin
private fun Args.writeGradleProperties() = File(projectDir, "gradle.properties").also { file ->
file.appendText("org.gradle.caching=true")

if (configurationCache) {
file.appendText("org.gradle.configuration-cache=true")
javaClass.classLoader.getResourceAsStream("testkit-gradle.properties")!!.use {
file.outputStream().use(it::copyTo)
}
}

Expand Down

0 comments on commit e97f56c

Please sign in to comment.