docs/sbt-cheatsheet.md
This document contains various references and notes about sbt build definition. One of the motivation for this document is that the official sbt documentation is not very informative.
streams.value.log.streams.value.log.error("My error")
[error] message. IF you want to fail a task, refer to
Fail a task.java.lang.RuntimeException.
inspect tree project/assembly
project / assembly is run.set asciiGraphWidth := 150.help inspect.print dependencyTree
Compile scope.print Test/dependencyTree
Test scope.--jvm-debug cmd line option to sbt which allows to attach a
debugger to the sbt process.
build.sbt, only to some
classes in the project directory. Moreover, once you run reload, the
debugging will not work for sure.
build.sbt a
various anonymous classes and the debugger does not see their sources.println directly, or to use
streams.value.log.info to log messages.fat-project is assembled via the fat-project / assembly task.fat-project / assembly / assemblyExcludedJars setting which is of
type Def.ClassPath.project one must:
project / Compile / exportJars := true. This ensures that
project / Compile / exportedProducts is a path to the jar.fat-project / assembly / assemblyExcludedJars get the path to the
project jar via project / Compile / exportedProducts.project / Compile / packageBin from
fat-project / assembly.assemblyExcludedJars setting only
works if it points to an already existing jar file.