-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 asDottyDep to sbt plugin #9974
add asDottyDep to sbt plugin #9974
Conversation
will need to add scripted tests, and rename it for the scala3 change |
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.
Do you think withDottyCompat
could handle both cases: when the Scala version is 2.13 it changes the binary version of the dependency to 0.27, and when the Scala version is 0.27 it changes the binary version of the dependency to 2.13?
Otherwise, I’m not a big fan of truncated names, I prefer asDottyDependency
over asDottyDep
, even though it’s longer.
Does it work in combination with Scala.js as well?
* libraryDependencies ~= (_.map(_.withDottyCompat(scalaVersion.value))) | ||
* }}} | ||
*/ | ||
def asDottyDep(scalaVersion: String): ModuleID = { |
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.
Could we have a simpler implementation by using the cross
operation? https://www.scala-sbt.org/1.x/docs/Cross-Build.html#More+about+using+cross-built+libraries
The current behavior of withDottyCompat was designed so that you could:
What you're proposing would break the crossScalaVersions usecase: suddenly adding withDottyCompat would mean that when the project is compiled with Scala 2, it would use a Scala 3 dependency and vice-versa which would be very confusing. So basically there's various usecases we need to keep in mind:
I think ideally we would only have one method to deal with all of those, with one or more parameters, I don't really know what that would look like but here's a tentative list of requirement:
Also I'd like to hear @sjrd opinion on this :). |
For sbt, one of my criteria is that the build is repeatable regardless of the state of Maven Central. Expanding the definition of cross might be a good direction to explore. For example, if we could add something like |
so should this be closed in favour of the other solutions? |
Well we still need a place for discussion I guess, maybe an issue on the sbt repo. |
we should probably keep it here because it seems sbt feature requests should be in their discuss forum |
Feel free to open an issue on sbt/sbt for this since it's a task that we're planning to deliver. I normally discourage ppl from opening an issue for blue sky ideas that no one works on. |
close for sbt/sbt#6080 |
This adds another convenience method to the plugin, now that we have the tasty reader in Scala 2. Which lets you do e.g.