Skip to content

Instantly share code, notes, and snippets.

@fwbrasil
Last active August 12, 2017 16:46
Show Gist options
  • Save fwbrasil/07272093ef61033102ce41952243f11b to your computer and use it in GitHub Desktop.
Save fwbrasil/07272093ef61033102ce41952243f11b to your computer and use it in GitHub Desktop.
# Requirement: the project must be on Scala 2.12.3
# Step 1 - Add the scalafix sbt plugin
echo 'addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.5.0-M4")' >> projecs/plugins.sbt
# Step 2 (MANUAL) - Add the traneio Scala Future dependency to the sbt build
# resolvers += Resolver.sonatypeRepo("snapshots")
# libraryDependencies += "io.trane" % "future-scala" % "0.2.3-SNAPSHOT"
# Step 2 - Run the scalafix rewrite
sbt scalafix replace:scala.concurrent.Await/io.trane.future.scala.Await replace:scala.concurrent.Future/io.trane.future.scala.Future replace:scala.concurrent.Promise/io.trane.future.scala.Promise
# Step 3 (MANUAL) - Fix compilation
# add 'import io.trane.future.scala._' to the source files that don't compile because of type mismatch
# and add `toScalaFuture`/`toScalaPromise` to convert scala future from libraries to the traneio future
# Profit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment