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

Combine with mill-tpolecat #241

Closed
davesmith00000 opened this issue Oct 13, 2024 · 6 comments
Closed

Combine with mill-tpolecat #241

davesmith00000 opened this issue Oct 13, 2024 · 6 comments

Comments

@davesmith00000
Copy link
Contributor

A few years ago @DavidGregory084 heroically ported sbt-tpolecat to mill-tpolecat, but it seems to have been left behind.

There is some setup to do, but it is possible to cross publish plugins to both sbt and Mill. It would be great to keep the two in sync. One issue that I wouldn't know how to start tackling if anyone did such a thing, would be the repo name... 😉

An alternative approach, perhaps, would be to publish a canonical list of recommended flags as a separate library, cross published to Scala 2.12, 2.13, and 3, divorced from any one build tool, so that it could be used by tool specific projects. Then the Mill-tpolecat lib could consume sbt-tpolecat-flags, as could other build tools or even individuals on an ad-hoc basis if they prefer.

@lenguyenthanh
Copy link
Member

An alternative approach, perhaps, would be to publish a canonical list of recommended flags as a separate library

Hi Dave, this is already a thing, We have scalac-options which contains recommended scalac options across scala versions. sbt-tpolecat uses it under the hood, but it seems mill-tpolecat doesn't use it yet. Maybe We should use scalac-options in mill-tpolecat as well.

@davesmith00000
Copy link
Contributor Author

Works like a charm, thanks @lenguyenthanh, example from my project for the curious:

...
import $ivy.`org.typelevel::scalac-options:0.1.7`, org.typelevel.scalacoptions._

trait ShaderModule extends MillIndigo {
  def scalaVersion   = "3.5.0"
  def scalaJSVersion = "1.17.0"

  override def scalacOptions = T {
    super.scalacOptions() ++
      ScalacOptions.defaultTokensForVersion(ScalaVersion.unsafeFromString(scalaVersion())) ++
      Seq("-Xfatal-warnings")
  }
..

I'll close this issue, but would it be worth updating the readme with a Mill example?

@lenguyenthanh
Copy link
Member

I'll close this issue, but would it be worth updating the readme with a Mill example?

glad that I could help and yes please 🙏

@davesmith00000
Copy link
Contributor Author

PR in ScalacOptions.
typelevel/scalac-options#150

@davesmith00000
Copy link
Contributor Author

PR in sbt-tpolecat
#242

@davesmith00000
Copy link
Contributor Author

PR in mill-tpolecat that I'm only 50% confident will work... but maybe someone will help me. 😅
DavidGregory084/mill-tpolecat#54

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

No branches or pull requests

2 participants