diff --git a/gradle-versions-plugin/src/main/kotlin/com/github/benmanes/gradle/versions/reporter/HtmlReporter.kt b/gradle-versions-plugin/src/main/kotlin/com/github/benmanes/gradle/versions/reporter/HtmlReporter.kt index d99a32af..0d3703ba 100644 --- a/gradle-versions-plugin/src/main/kotlin/com/github/benmanes/gradle/versions/reporter/HtmlReporter.kt +++ b/gradle-versions-plugin/src/main/kotlin/com/github/benmanes/gradle/versions/reporter/HtmlReporter.kt @@ -17,10 +17,21 @@ class HtmlReporter( override val gradleReleaseChannel: String, ) : AbstractReporter(project, revision, gradleReleaseChannel) { override fun write(printStream: OutputStream, result: Result) { + printStream.println("") + printStream.println("") writeHeader(printStream) + writeBody(printStream, result) + printStream.println("") + } + + private fun writeHeader(printStream: OutputStream) { + printStream.println(header.trimMargin()) + } + private fun writeBody(printStream: OutputStream, result: Result) { + printStream.println("") if (result.count == 0) { - printStream.println("

No dependencies found.

") + printStream.println("

No dependencies found.

") } else { writeUpToDate(printStream, result) writeExceedLatestFound(printStream, result) @@ -28,18 +39,14 @@ class HtmlReporter( writeUndeclared(printStream, result) writeUnresolved(printStream, result) } - writeGradleUpdates(printStream, result) - } - - private fun writeHeader(printStream: OutputStream) { - printStream.println(header.trimMargin()) + printStream.println("") } private fun writeUpToDate(printStream: OutputStream, result: Result) { val versions = result.current.dependencies if (versions.isNotEmpty()) { - printStream.println("

Current dependencies

") + printStream.println("

Current dependencies

") printStream .println("

The following dependencies are using the latest $revision version:

") printStream.println("") @@ -56,7 +63,7 @@ class HtmlReporter( if (versions.isNotEmpty()) { // The following dependencies exceed the version found at the " // + revision + " revision level: - printStream.println("

Exceeded dependencies

") + printStream.println("

Exceeded dependencies

") printStream.println( "

The following dependencies exceed the version found at the $revision revision level:

" ) @@ -72,7 +79,7 @@ class HtmlReporter( private fun writeUpgrades(printStream: OutputStream, result: Result) { val versions = result.outdated.dependencies if (versions.isNotEmpty()) { - printStream.println("

Later dependencies

") + printStream.println("

Later dependencies

") printStream.println("

The following dependencies have later $revision versions:

") printStream.println("

") for (it in getUpgradesRows(result)) { @@ -86,7 +93,7 @@ class HtmlReporter( private fun writeUndeclared(printStream: OutputStream, result: Result) { val versions = result.undeclared.dependencies if (versions.isNotEmpty()) { - printStream.println("

Undeclared dependencies

") + printStream.println("

Undeclared dependencies

") printStream.println( "

Failed to compare versions for the following dependencies because they were declared without version:

" ) @@ -102,7 +109,7 @@ class HtmlReporter( private fun writeUnresolved(printStream: OutputStream, result: Result) { val versions = result.unresolved.dependencies if (versions.isNotEmpty()) { - printStream.println("

Unresolved dependencies

") + printStream.println("

Unresolved dependencies

") printStream .println("

Failed to determine the latest version for the following dependencies:

") printStream.println("

") @@ -118,32 +125,29 @@ class HtmlReporter( if (!result.gradle.enabled) { return } - - printStream.println("

Gradle $gradleReleaseChannel updates

") - + printStream.println("

Gradle $gradleReleaseChannel updates

") printStream.println("Gradle $gradleReleaseChannel updates:") // Log Gradle update checking failures. if (result.gradle.current.isFailure) { printStream.println( - "

[ERROR] [release channel: ${CURRENT.id}] " + result.gradle.current.reason + "

" + "

[ERROR] [release channel: ${CURRENT.id}] " + result.gradle.current.reason + "

" ) } if ((gradleReleaseChannel == RELEASE_CANDIDATE.id || gradleReleaseChannel == NIGHTLY.id) && result.gradle.releaseCandidate.isFailure ) { printStream.println( - "

[ERROR] [release channel: ${RELEASE_CANDIDATE.id}] " + result - .gradle.releaseCandidate.reason + "

" + "

[ERROR] [release channel: ${RELEASE_CANDIDATE.id}] " + result.gradle.releaseCandidate.reason + "

" ) } if (gradleReleaseChannel == NIGHTLY.id && result.gradle.nightly.isFailure) { printStream.println( - "

[ERROR] [release channel: ${NIGHTLY.id}] " + result.gradle.nightly.reason + "

" + "

[ERROR] [release channel: ${NIGHTLY.id}] " + result.gradle.nightly.reason + "

" ) } // print Gradle updates in breadcrumb format - printStream.print("

Gradle: [" + getGradleVersionUrl(result.gradle.running.version)) + printStream.print("

Gradle: [" + getGradleVersionUrl(result.gradle.running.version)) var updatePrinted = false if (result.gradle.current.isUpdateAvailable && result.gradle.current > result.gradle.running) { updatePrinted = true @@ -168,7 +172,7 @@ class HtmlReporter( if (!updatePrinted) { printStream.print(": UP-TO-DATE") } - printStream.println("]

") + printStream.println("]

") printStream.println(getGradleUrl()) } @@ -216,13 +220,13 @@ class HtmlReporter( companion object { private const val header = """ - - Project Dependency Updates Report - - - - + + """ private fun getCurrentRows(result: Result): List { @@ -389,7 +390,7 @@ class HtmlReporter( } private fun getGradleUrl(): String { - return "

For information about Gradle releases click here." + return "

For information about Gradle releases click here.

" } private fun getGradleVersionUrl(version: String?): String { diff --git a/gradle.properties b/gradle.properties index 8bb25a60..dce12a0f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ GROUP=com.github.ben-manes -VERSION_NAME=0.44.0 +VERSION_NAME=0.45.0 POM_INCEPTION_YEAR=2012 POM_PACKAGING=jar