All Downloads are FREE. Search and download functionalities are using the official Maven repository.

kotlinx.kover.gradle.plugin.tools.jacoco.JacocoHtmlOrXmlReport.kt Maven / Gradle / Ivy

There is a newer version: 0.9.0-RC
Show newest version
/*
 * Copyright 2017-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
 */

package kotlinx.kover.gradle.plugin.tools.jacoco

import kotlinx.kover.gradle.plugin.commons.*
import java.io.*


internal fun ReportContext.jacocoHtmlReport(htmlDir: File, title: String, charset: String?) {
    callAntReport(title) {
        htmlDir.mkdirs()

        val element = if (charset != null) {
            mapOf("destdir" to htmlDir, "encoding" to charset)
        } else {
            mapOf("destdir" to htmlDir)
        }
        invokeMethod("html", element)
    }
}

internal fun ReportContext.jacocoXmlReport(xmlFile: File, title: String) {
    callAntReport(title) {
        xmlFile.parentFile.mkdirs()
        invokeMethod("xml", mapOf("destfile" to xmlFile))
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy