-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Scala 3 crossbuilds, raise min version to 1.5.8 #256
Conversation
There is #255 |
This one looks better than #255, so let's continue here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good but I thing we should wrap Terminal.console
in a try catch
@@ -17,14 +18,14 @@ object ConsoleGitRunner extends GitRunner { | |||
|
|||
// in order to enable colors we trick git into thinking we're a pager, because it already knows we're not a tty | |||
val colorSupport: Seq[(String, String)] = | |||
if(ConsoleLogger.formatEnabled) Seq("GIT_PAGER_IN_USE" -> "1") | |||
if(Terminal.console.isAnsiSupported) Seq("GIT_PAGER_IN_USE" -> "1") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Terminal.console
can throw an IllegalStateException
here so it should be wrapped with try catch
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used monadic Try
, lemme know if you prefer try/catch
for some reason. There's a few other places where Try
is used in the plugin, but it's certainly not uniform.
@@ -29,13 +29,13 @@ final class JGit(val repo: Repository) extends GitReadonlyInterface { | |||
def branch: String = repo.getBranch | |||
|
|||
private def branchesRef: Seq[Ref] = { | |||
import collection.JavaConverters._ | |||
porcelain.branchList.call.asScala | |||
import scala.jdk.CollectionConverters._ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is repeated 6 times. I suggest to move the import to the top of the file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I'll get right on that.
I was thinking the same thing as I was making this conversion. I didn't do this because I haven't worked on the internals here, and wasn't sure if this was a runtime optimization or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Towards #257
1.5.8
for1.x
crossbuilds and scala crossbuilds+ compile
and+ test
all work successfully. However^test
runs into a cyclical error. Since we're using 2/3 crossbuilding everywhere else (with matrices), I opted to remove the old crossbuild for now. Will add the 2.0 + scala3 matrix to CI later.