-
Notifications
You must be signed in to change notification settings - Fork 44
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
WIP use sbt 2.0.0-M4 & cross-build against it #440
base: main
Are you sure you want to change the base?
Conversation
c9451e2
to
42e7e69
Compare
@@ -155,21 +155,21 @@ object ScalafixEnable { | |||
} else { | |||
val latestAvailable = | |||
tail.lastOption.getOrElse(earliestAvailable) | |||
Seq( |
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 was picked as significant indentation by the compiler (and has been also all along by scalafmt, as scala3 is aggressively/incorrectly used on all files as dialect), which was causing latestAvailable
's type to be recursive ...
0bc3b43
to
50acf94
Compare
ea0dc68
to
077670f
Compare
.get(Keys.moduleIDStr) | ||
.map(Classpaths.moduleIdJsonKeyFormat.read) |
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.
ffeacb0
to
1b3e208
Compare
4060b04
to
55d9026
Compare
0ffcf86
to
ab7704f
Compare
def toPath( | ||
attributed: Attributed[HashedVirtualFileRef] | ||
)(using conv: FileConverter): Path = | ||
conv.toPath(attributed.data) | ||
|
||
def toFile( | ||
attributed: Attributed[HashedVirtualFileRef] | ||
)(using conv: FileConverter): File = | ||
toPath(attributed).toFile() |
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.
"sbt." | ||
"*" | ||
] | ||
targetDialect = Scala3 |
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.
Thanks to -Xsource:3
(which was added by default for sbt1 but was removed in sbt2, needing an explicit addition in this PR), Scala 3 import syntax can be used sbt1 metabuilds (and thus sb1 plugins) .
So we might as well start using OrganizeImports with Scala 3 syntax for all files (not just the Scala 3 ones), as we start enforcing scalafix for ExplicitResultTypes
@@ -7,6 +7,7 @@ object Dependencies { | |||
val all = List( | |||
"org.eclipse.jgit" % "org.eclipse.jgit" % "5.13.3.202401111512-r", | |||
"ch.epfl.scala" % "scalafix-interfaces" % scalafixVersion, | |||
"io.get-coursier" % "interface" % "1.0.28" | |||
"io.get-coursier" % "interface" % "1.0.28", | |||
"org.scala-lang.modules" %% "scala-collection-compat" % "2.13.0" |
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.
helps getting rid of import scala.collection.JavaConverters.*
mostly
@@ -376,19 +383,19 @@ object ScalafixPlugin extends AutoPlugin { | |||
|
|||
} | |||
|
|||
private def scalafixAllInputTask(): Def.Initialize[InputTask[Unit]] = { | |||
// workaround https://github.com/sbt/sbt/issues/3572 by invoking directly what Def.inputTaskDyn would via macro |
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.
9ea8c73
to
31bc4fc
Compare
- run: ./bin/scalafmt --test | ||
- run: sbt "scalafixAll --check" |
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.
enforcing scalafix in this PR mostly for ExplicitResultTypes, to have deterministic types from the beginning for the sbt 2.x artifact
cdf1d14
to
539b3f4
Compare
ea8ff83
to
cf75fe4
Compare
@@ -1 +1 @@ | |||
sbt.version=1.10.7 | |||
sbt.version=2.0.0-M4 |
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.
.github/workflows/ci.yml
Outdated
strategy: | ||
fail-fast: false | ||
matrix: | ||
scala: ["2.12"] |
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.
Run sbt ++2.12 test-skip-windows scripted
[info] entering *experimental* thin client - BEEP WHIRR
[info] server was not detected. starting an instance
[error] Failed to start server : java.io.IOException: Cannot run program "C:/Program Files" (in directory "D:\a\sbt-scalafix\sbt-scalafix"): CreateProcess error=5, Access is denied
[error] failed to connect to server
@@ -1,12 +1,12 @@ | |||
resolvers ++= Resolver.sonatypeOssRepos("public") | |||
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.9.2") | |||
//addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.9.2") |
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.
https://www.scala-sbt.org/2.x/docs/en/changes/migrating-from-sbt-1.x.html
https://github.com/sbt/sbt/wiki/sbt-2.x-plugin-migration
Remaining