diff --git a/CHANGELOG.md b/CHANGELOG.md index 8101b67..87f049c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ This list is not intended to be all-encompassing - it will document major and breaking changes with their rationale when appropriate: +### v1.0.1 +- Fix: multiple sourceinfo entries support in the jacoco report +- ### v1.0.0 - Initial major release - configuration change [Breaking]: `intputFile` and `outputFile` now take a File as param instead of string path diff --git a/gradle.properties b/gradle.properties index 7a0b8c1..cc197d9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,2 +1,2 @@ kotlin.code.style=official -version=1.0.0 +version=1.0.1 diff --git a/src/main/kotlin/models.kt b/src/main/kotlin/models.kt index a49bdc4..9974259 100644 --- a/src/main/kotlin/models.kt +++ b/src/main/kotlin/models.kt @@ -193,8 +193,8 @@ class Jacoco { @field:Attribute(name = "name", required = true) lateinit var name: String - @field:Element(name = "sessioninfo", required = true) - lateinit var sessionInfo: SessionInfo + @field:ElementList(name = "sessioninfo", required = false, inline = true) + var sessionInfos: List = mutableListOf() @field:ElementList(name = "package", required = false, inline = true) var packages: List = mutableListOf() @@ -202,7 +202,7 @@ class Jacoco { @field:ElementList(name = "counter", required = false, inline = true) override var counters: List = mutableListOf() - fun timestamp(): Long = sessionInfo.start?.toLongOrNull()?.let { it / 1000 } ?: 0 + fun timestamp(): Long = sessionInfos.firstOrNull()?.start?.toLongOrNull()?.let { it / 1000 } ?: 0 fun packagesNames() = packages.mapNotNull(PackageElement::name).toSet() @@ -315,7 +315,7 @@ class Jacoco { fun Jacoco.Report.print() { println(name) - println(sessionInfo.id) + println(sessionInfos.map(Jacoco.SessionInfo::id).joinToString(", ")) packages.forEach { println(" package: ${it.name}") it.classes.forEach {