-
Notifications
You must be signed in to change notification settings - Fork 550
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
Upgrade to Scala v2.13 #425
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rtyley
commented
Feb 13, 2021
@@ -13,6 +13,10 @@ object Dependencies { | |||
// the 1.7.2 here matches slf4j-api in jgit's dependencies | |||
val slf4jSimple = "org.slf4j" % "slf4j-simple" % "1.7.2" | |||
|
|||
val scalaCollectionPlus = "com.madgag" %% "scala-collection-plus" % "0.5" |
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.
See https://github.com/rtyley/scala-collection-plus, which provides mapV
& groupUp
rtyley
commented
Feb 13, 2021
Comment on lines
76
to
80
override def clear(): Unit = ??? | ||
|
||
override def result(): ConcurrentSet[A] = ??? | ||
|
||
override def addOne(elem: A): ConcurrentSetBuilder.this.type = ??? |
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.
Bit dodge
rtyley
force-pushed
the
upgrade-to-scala-v2.13
branch
6 times, most recently
from
February 15, 2021 20:38
52fa084
to
e55c037
Compare
rtyley
force-pushed
the
upgrade-to-scala-v2.13
branch
3 times, most recently
from
February 27, 2021 11:36
88869f7
to
87e4de2
Compare
Key challenges with the upgrade: * The [`scala-io`](https://github.com/jesseeichar/scala-io) library is not available for Scala 2.13 (I had custom-built the Scala 2.12 version, but it was too much effort to get it to 2.13). `scala-io` was providing several useful features: * streaming reading of character data with line-splitting that *preserves line-breaks* (because I don't want the BFG to change the line-breaks in your files while doing `--replace-text`). Finding a replacement library to do this wasn't easy - so much code seems to be based on `java.io.BufferedReader`, which throws line-breaks away. `java.util.Scanner` can _maybe_ do it, but I couldn't get it to work! In the end, I implemented my own solution, a tiny library with a fairly decent set of tests: https://github.com/rtyley/line-break-preserving-line-splitting * resource management - mostly replaced by using Scala 2.13's [`Using`](https://www.scala-lang.org/api/current/scala/util/Using$.html). * File-path types and operations - mostly now performed by java.nio & Guava functions. * Scala 2.13 has a [revised collections framework](https://docs.scala-lang.org/overviews/core/collections-migration-213.html), so: * BFG has its own `ConcurrentSet` which needs to be implemented in the new fashion * `Traversable` becomes `Iterable`, etc
rtyley
force-pushed
the
upgrade-to-scala-v2.13
branch
from
February 27, 2021 11:41
87e4de2
to
405fe42
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Key challenges with the upgrade:
scala-io
library is not available for Scala 2.13 (I had custom-built the Scala 2.12 version, but it was too much effort to get it to 2.13).scala-io
was providing several useful features:--replace-text
). Finding a replacement library to do this wasn't easy - so much code seems to be based onjava.io.BufferedReader
, which throws line-breaks away.java.util.Scanner
can maybe do it, but I couldn't get it to work! In the end, I implemented my own solution, a tiny library with a fairly decent set of tests: https://github.com/rtyley/line-break-preserving-line-splittingUsing
.ConcurrentSet
which needs to be implemented in the new fashionTraversable
becomesIterable
, etc