1

I work on a project and I want to let the choice of using ammonite at each developer.

So I have to share the initialCommands to avoid dups.

Here are my current solution.

val initCommands = s""" val sc = new org.apache.spark.SparkContext("local", "shell"); val sqlContext = new org.apache.spark.sql.SQLContext(sc); import sqlContext.implicits._; import org.apache.spark.sql.functions._ """

val escaped = initCommands.replace("\"", "\\\"")

initialCommands in console := initCommands

initialCommands in (Test, console) := s"""ammonite.Main(predef = "$escaped").run()"""

First issue is that initCommands have to be on one line.

Is there a better way ?

Yann Moisan
  • 8,161
  • 8
  • 47
  • 91

0 Answers0