Skip to content

Commit

Permalink
Fix printed version in case a Gradle distribution in selected from th…
Browse files Browse the repository at this point in the history
…e cache
  • Loading branch information
nc-bmv committed Oct 1, 2020
1 parent 81ba1b2 commit 7cda7d2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 0 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ tasks.withType<Wrapper> {
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
// The source and target compatibility only functions as a hint to IntelliJ when importing project for selecting the correct JDK
sourceCompatibility = JavaVersion.VERSION_11.toString()
targetCompatibility = JavaVersion.VERSION_11.toString()

kotlinOptions {
jvmTarget = JavaVersion.VERSION_11.toString()
}
Expand Down
6 changes: 5 additions & 1 deletion src/main/kotlin/com/github/bjornvester/gww/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ private fun getVersionFromGradlePath(path: Path): Version? {
/**
* Simple version class. Only supports numbers and does not work with text (e.g. "rc-1").
*/
private class Version(val version: String) : Comparable<Version> {
private data class Version(val version: String) : Comparable<Version> {
override fun compareTo(other: Version): Int {
val version1Splits = version.split(".")
val version2Splits = other.version.split(".")
Expand All @@ -140,4 +140,8 @@ private class Version(val version: String) : Comparable<Version> {

return comparisonResult
}

override fun toString(): String {
return version
}
}

0 comments on commit 7cda7d2

Please sign in to comment.