Skip to content

Commit

Permalink
Fix EAP versions support, improve error message
Browse files Browse the repository at this point in the history
  • Loading branch information
rock3r committed Oct 24, 2023
1 parent d263044 commit 83d190e
Showing 1 changed file with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ open class CheckIdeaVersionTask : DefaultTask() {
"fields=code,releases,releases.version,releases.build,releases.type&" +
"code=IC"

private val versionRegex = "2\\d{2}\\.\\d+\\.\\d+(?:EAP-SNAPSHOT)?".toRegex(RegexOption.IGNORE_CASE)
private val versionRegex = "2\\d{2}\\.\\d+\\.\\d+(?:-EAP-SNAPSHOT)?".toRegex(RegexOption.IGNORE_CASE)

init {
group = "jewel"
Expand Down Expand Up @@ -77,10 +77,16 @@ open class CheckIdeaVersionTask : DefaultTask() {
val currentPlatformBuild = rawPlatformBuild.substringBefore('-')
if (VersionComparator.compare(currentPlatformBuild, latestAvailableBuild.build) < 0) {
throw GradleException(
"IntelliJ Platform version dependency is out of date.\n" +
"Current build: $currentPlatformBuild\n" +
"Latest build: ${latestAvailableBuild.build}\n" +
"Detected channel: ${if (isCurrentBuildStable) "stable" else "non-stable (eap/beta/rc)"}"
buildString {
appendLine("IntelliJ Platform version dependency is out of date.")
appendLine()
appendLine("Current build: $rawPlatformBuild")
append("Latest build: ${latestAvailableBuild.build}")
if (!isCurrentBuildStable) append("-EAP-SNAPSHOT")
appendLine()
append("Detected channel: ")
appendLine(if (isCurrentBuildStable) "stable" else "non-stable (eap/beta/rc)")
}
)
}
logger.lifecycle("No IntelliJ Platform version updates available. Current: $currentPlatformBuild")
Expand Down

0 comments on commit 83d190e

Please sign in to comment.