Skip to content

Commit

Permalink
Make sure 1.10.0 is higher than 1.10.0-SNAPSHOT in version check #…
Browse files Browse the repository at this point in the history
  • Loading branch information
hsz committed Nov 17, 2022
1 parent 0f3c205 commit 2e3b539
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Added
- Set `IDEA_PLUGIN_SANDBOX_MODE` to `true` for `runIde`-based tasks
- The `listBundledPlugins` task for listing IDs of plugins bundled within the currently targeted IDE
- Make sure `1.10.0` is higher than `1.10.0-SNAPSHOT` in version check [#1155](../../issues/1155)

### Fixed
- Invalidate instrumented classes bound to forms if GUI changed [IDEA-298989](https://youtrack.jetbrains.com/issue/IDEA-298989/Duplicate-method-name-getFont)
Expand Down
7 changes: 7 additions & 0 deletions src/main/kotlin/org/jetbrains/intellij/Version.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ class Version(
(major - other.major)
.or { minor - other.minor }
.or { patch - other.patch }
.or {
when {
version.contains('-') -> -1
other.version.contains('-') -> 1
else -> 0
}
}
.or { version.compareTo(other.version, ignoreCase = true) }

override fun toString() = version.takeIf(String::isNotEmpty) ?: "$major.$minor.$patch"
Expand Down

0 comments on commit 2e3b539

Please sign in to comment.