Spark : how to run spark file from spark shell

In command line, you can use

spark-shell -i file.scala

to run code which is written in file.scala


To load an external file from spark-shell simply do

:load PATH_TO_FILE

This will call everything in your file.

I don't have a solution for your SBT question though sorry :-)