Skip to content

Commit

Permalink
Update HTML report path to be clickable
Browse files Browse the repository at this point in the history
Fixes HTML report paths not being clickable

Closes #470

PR #471
  • Loading branch information
Ezard authored Oct 10, 2023
1 parent 84f1b12 commit 58e2c95
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ package kotlinx.kover.gradle.plugin.tasks.reports
import org.gradle.api.file.*
import org.gradle.api.provider.Property
import org.gradle.api.tasks.*
import java.io.File
import java.net.URI

@CacheableTask
internal abstract class KoverHtmlTask : AbstractKoverReportTask() {
Expand All @@ -28,7 +30,14 @@ internal abstract class KoverHtmlTask : AbstractKoverReportTask() {
}

fun printPath(): Boolean {
logger.lifecycle("Kover: HTML report for '$projectPath' file://${reportDir.get().asFile.canonicalPath}/index.html")
val clickablePath = URI(
"file",
"",
File(reportDir.get().asFile.canonicalPath, "index.html").toURI().path,
null,
null,
).toASCIIString()
logger.lifecycle("Kover: HTML report for '$projectPath' $clickablePath")
return true
}
}

0 comments on commit 58e2c95

Please sign in to comment.