Skip to content
Draft
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ git.baseVersion := "1.0"

libraryDependencies ++= Seq(
"org.eclipse.jgit" % "org.eclipse.jgit" % "5.13.3.202401111512-r",
"com.michaelpollmeier" % "versionsort" % "1.0.11",
"com.github.zafarkhaja" % "java-semver" % "0.10.2",
"org.scalameta" %% "munit" % "1.0.2" % Test
)

Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.10.6
sbt.version=1.10.6
8 changes: 7 additions & 1 deletion src/main/scala/com/github/sbt/git/GitPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.github.sbt.git
import sbt.*
import Keys.*


/** This plugin has all the basic 'git' functionality for other plugins. */
object SbtGit {

Expand Down Expand Up @@ -317,7 +318,12 @@ object SbtGit {
} yield version

// NOTE - Selecting the last tag or the first tag should be an option.
val highestVersion = versions.sortWith { versionsort.VersionHelper.compare(_, _) > 0 }.headOption
val highestVersion =
versions
.map(Version.parse)
.sortWith(_.compareTo(_) > 0)
.headOption
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eed3si9n I didn't manage to use it, can you try it yourself?


highestVersion.map(_ + suffix)
}

Expand Down
2 changes: 1 addition & 1 deletion test-project/project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.1.0
sbt.version=1.10.1
Loading