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.
As the result of the Scala hackathon we created a change that’s the following snippet (that ultimately may become part of
val cm = universe.runtimeMirror(getClass.getClassLoader)
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
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.