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

kotlinx.kover.gradle.plugin.tools.jacoco.JacocoOnlineInstrumentation.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 java.io.*

internal fun buildJvmAgentArgs(jarFile: File, binReportFile: File, excludedClasses: Set): List {
    val agentArgs = listOfNotNull(
        "destfile=${binReportFile.canonicalPath},append=true,inclnolocationclasses=true,dumponexit=true,output=file,jmx=false",
        excludedClasses.joinToFilterString("excludes")
    ).joinToString(",")

    return listOf("-javaagent:${jarFile.canonicalPath}=$agentArgs")
}

private fun Collection.joinToFilterString(filterName: String): String? {
    if (isEmpty()) return null
    return filterName + "=" + joinToString(":")
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy