scala - How can I have some code loaded in sbt console? -
i'd have code loaded/interpreted upon running sbt console
. same code shared between projects.
think of makes sense in interactive session (eg. timing functions) - .irbrc
ruby, pythonstartup script python ..etc.
well, following answer sacha kolberg's comment, adapted this: https://github.com/herenowcoder/rcfiles/blob/8965c73/build.sbt
still, requires chunk of code copied every sbt project. having elegant solution of setting projects (per unix user)..?
i played .sbtrc
no luck.
[edit]
by way, cool loading commands way, console prints type signatures of eval'ed stuff:
[info] starting scala interpreter... [info] time: [r](block: => r)r welcome scala version 2.11.2 (java hotspot(tm) 64-bit server vm, java 1.8.0_60).
still, i'm looking way include such code every project. in style of elixir's .iex.exs
machinery.
[edit]
found it!
instead of adding initialcommands in console := "..."
section every project involved, it's sufficient put in ~/.sbt/0.13/build.sbt
, or - more correct - ~/.sbt/0.13/global.sbt
(both work).
thanks sascha kolberg putting me on right track!
Comments
Post a Comment