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 Scala 3 support #101

Merged
merged 4 commits into from
Oct 13, 2024
Merged

Add Scala 3 support #101

merged 4 commits into from
Oct 13, 2024

Conversation

kubukoz
Copy link
Contributor

@kubukoz kubukoz commented Oct 5, 2024

To unblock Bloop's ability to cross-build sbt-bloop for sbt 2.0 (sbt/sbt#7698).

@kubukoz kubukoz marked this pull request as ready for review October 5, 2024 13:41
with CommonPublish
with CommonPublish {

// note: somehow, this doesn't work (causes "Please override mimaPreviousVersions or mimaPreviousArtifacts")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

thought: I didn't spend too much time on it, hoping someone with more Mill experience can provide a better understanding and maybe a proper fix. This seems like something that only affects us until we publish the 3.x support.

@@ -0,0 +1,3 @@
package bloop.config

trait SourceGeneratorCompanionPlatform {}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

thought: extends AbstractFunction3 was causing a "missing apply method" in Scala 3. Adding that apply was conflicting with the other apply - hence, version-specific sources.

Copy link
Contributor

@tgodzik tgodzik left a comment

Choose a reason for hiding this comment

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

Thanks! We might want to switch to JDK 11 since jsoniter dropped support for JDK 8, which should not be an issue for the tools using bloop-config.

Also, looks like scalafix is not passing. We can disable it for Scala 3 if it proves to difficult to fix.

@kubukoz
Copy link
Contributor Author

kubukoz commented Oct 12, 2024

Tried just disabling removeUnused for Scala 3 this way:

  def extraArgs = T {
    if(scalaVersion() == scala3) List("---settings.OrganizeImports.removeUnused=false")
    else Nil
  }

  override def fix(args: String*): Command[Unit] = T.command {
    val allArgs = args ++ extraArgs()

    super.fix(allArgs: _*)()
  }

but Mill complains:

[error] bloop-config/build.sc:73:15: Target#apply() call cannot use `value allArgs` defined within the T{...} block
[error]     super.fix(allArgs: _*).apply()
[error]               ^
[error] one error found
1 targets failed

which I don't really understand yet...

Copy link
Contributor

@tgodzik tgodzik left a comment

Choose a reason for hiding this comment

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

Should be fixed now, should we do a release now?

@tgodzik tgodzik merged commit eeb76eb into scalacenter:main Oct 13, 2024
4 checks passed
@kubukoz kubukoz deleted the add-scala3 branch October 13, 2024 21:36
@kubukoz
Copy link
Contributor Author

kubukoz commented Oct 13, 2024

Can't hurt 😅

@tgodzik
Copy link
Contributor

tgodzik commented Oct 14, 2024

It should be out!

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.

2 participants