Skip to content
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

Merged
merged 9 commits into from
Oct 8, 2024

Conversation

BillyAutrey
Copy link
Contributor

@BillyAutrey BillyAutrey commented Oct 7, 2024

Towards #257

  • Raises minimum version to 1.5.8 for 1.x crossbuilds and scala crossbuilds
  • Adds support for Scala 3 and SBT 2.0.0 crossbuilds
  • Catches a few more missed slash format errors
  • Fixes Scala 3 type errors, warnings, deprecations
  • Fixes SBT 1.5 deprecations, warnings

+ 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.

@mzuehlke
Copy link

mzuehlke commented Oct 8, 2024

There is #255

@agboom
Copy link

agboom commented Oct 8, 2024

This one looks better than #255, so let's continue here

Copy link
Member

@adpi2 adpi2 left a 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")
Copy link
Member

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.

Copy link
Contributor Author

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._
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@BillyAutrey BillyAutrey requested a review from adpi2 October 8, 2024 13:22
Copy link
Member

@adpi2 adpi2 left a comment

Choose a reason for hiding this comment

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

LGTM

@eed3si9n eed3si9n merged commit 8fe8f36 into sbt:main Oct 8, 2024
1 check passed
@BillyAutrey BillyAutrey deleted the fix-sbt-deprecation-warnings branch October 8, 2024 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants