Hacking #scalasbt with @gkossakowski on @WarszawScaLa meetup in @javeo_eu

It’s amazing how much I could learn hacking with so many clever Scala developers in one room during 2,5-hour meetup of @WarszawScaLa. Today was the day of #Scalania 22 during which Grzegorz Kossakowski @gkossakowski from Typesafe explained the changes needed to get rid of blank lines found in *.sbt build files in sbt. Thanks so much @javeo_eu for the food and venue. Many thanks Grzegorz for leading the meetup. Thanks the other Scala developers for the atmosphere.

Scalania 22  with Grzegorz

As the result of the Scala hackathon we created a change that’s the following snippet (that ultimately may become part of sbt.EvaluateConfigurations object):

def splitExpressions(lines: Seq[String]): (Seq[(String, Int)], Seq[(String, LineRange)]) =
  import scala.reflect.runtime._
  val cm = universe.runtimeMirror(getClass.getClassLoader)
  import scala.tools.reflect.ToolBox
  val tb = cm.mkToolBox(scala.tools.reflect.mkSilentFrontEnd(), "-Yrangepos")
  val buildSbt = lines.mkString
  val parsed = tb.parse(buildSbt)
  val b = parsed.asInstanceOf[scala language=".reflect.internal.Trees#Block"][/scala]
  val t = b.stats :+ b.expr
  // val s = t.flatMap(e => buildSbt.substring(e.pos.start, e.pos.end)).mkString
  (Seq.empty, Seq.empty)

It’s surely going to take more time to polish the changes until it’s merged to sbt however the meetup showed us how much we can hack together when the topic under discussion is well-presented and the meeting led by highly-skilled developers. Kudos to Grzegorz for leading the meetup! I can’t wait to the next Scala shackathons.

Be Sociable, Share!
This entry was posted in Languages.

Leave a Reply

%d bloggers like this: