Search code examples
scalasbt

How do I create a custom scala library using sbt?


Like it says on the tin, how would I go by creating a library using sbt?

I have a set of utilities and convenience functions that I want to be easily distributed between my projects. The easiest way to do this of course, is by having them compile to a library, that I can then include in the build path of any given project that'll use it.

Libraries are often much easier to include in multiple projects than having multiple copies of the same classes. So how would I do this?


Solution

  • Just create a project with the library code, and use the publishLocal command to put it in your local Ivy repo. Then you can include it in other projects.