Skip to content

Commit 53d17e4

Browse files
authored
Reports should use system line separators (#13)
1 parent 9bc55f1 commit 53d17e4

File tree

4 files changed

+4
-6
lines changed

4 files changed

+4
-6
lines changed

src/main/kotlin/com/ebay/plugins/metrics/develocity/GatherAggregateTask.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ open class GatherAggregateTask @Inject constructor(
5151
val inputs = sourceOutputDirectories.files
5252
.sorted()
5353
.joinToString(prefix = "Aggregating sources:\n\t", separator = "\n\t") { it.name }
54+
.replace("\n", System.lineSeparator())
5455
outputDirectoryProperty.file("inputs").get().asFile.writeText(inputs)
5556

5657
val summarizerStates = summarizersProperty.get().map { MetricSummarizerState(it) }

src/main/kotlin/com/ebay/plugins/metrics/develocity/GatherHourlyTask.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ open class GatherHourlyTask @Inject constructor(
100100
// Fail task execution if we receive any error responses
101101
val errorHandler: (response: HttpResponse) -> Unit = {
102102
runBlocking {
103-
throw GradleException("Failed to get builds: ${it.call.response.status}\n\t${it.call.response.bodyAsText()}")
103+
throw GradleException("Failed to get builds: ${it.call.response.status}${System.lineSeparator()}\t${it.call.response.bodyAsText()}")
104104
}
105105
}
106106

src/main/kotlin/com/ebay/plugins/metrics/develocity/projectcost/ProjectCostInspectionTask.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ internal abstract class ProjectCostInspectionTask : DefaultTask(), MetricSummari
116116
append(topTypesByExecutions)
117117
append(impactedUserReport)
118118
append(buildScansReport)
119-
}
119+
}.replace("\n", System.lineSeparator())
120120
outputFile.asFile.get().also { reportFile ->
121121
logger.lifecycle("Project cost inspection report available at: file://${reportFile.absolutePath}")
122122
reportFile.writeText(report)

src/main/kotlin/com/ebay/plugins/metrics/develocity/userquery/UserQueryReportTask.kt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,14 @@ internal abstract class UserQueryReportTask : DefaultTask(), MetricSummarizerTas
1616
@get:OutputFile
1717
abstract val reportFile: RegularFileProperty
1818

19-
init {
20-
group = "graph analytics"
21-
}
22-
2319
@TaskAction
2420
fun createReport() {
2521
val summaryFile = summarizerDataProperty.get()
2622
val model = UserQuerySummarizer().read(summaryFile)
2723
val report = model.users.sorted().joinToString(
2824
prefix = "User(s) who have performed builds matching the query filter (${model.users.size}):\n ",
2925
separator = "\n ")
26+
.replace("\n", System.lineSeparator())
3027
reportFile.asFile.get().also { reportFile ->
3128
logger.lifecycle("User report available at: file://${reportFile.absolutePath}")
3229
reportFile.writeText(report)

0 commit comments

Comments
 (0)