zunior
zunior

Reputation: 861

How to import directory of .scala files in sbt (unmanaged)?

I have a directory that I want to use as a dependancy for an sbt project however its comprised of .scala files which means I can't place it inside a jar (from what I understand) so then how can I use it as a dependancy for my project? (sbt doesn't have it as a managed dependancy) thanks in advance

Upvotes: 1

Views: 875

Answers (1)

gilad hoch
gilad hoch

Reputation: 2866

as written in the manual, you can customize the sources (or source directories) pretty freely. by default, sbt will expect to have scala and java sources under a source directory. you can customize that too. depending on your exact use case, maybe you want these sources under a different configuration? if it's just extra sources to compile and package, you can simply use:

sourceDirectories in Compile += file("/path/to/your/sources")

or:

unmanagedSourceDirectories in Compile += file("/path/to/your/sources")

use the first when the sources are managed, e.g: if these sources are generated by some other program, or retrieved as a dependency, etc'... use the second when these are plain sources not managed by anything.

Upvotes: 2

Related Questions