Each project in SBT has a target directory. What happens to its compiled classes and other generated things.
Your root is the project, and TARGET 3 in your diagram is its goal.
Your build definition ( project directory) is also a project. With SBT, you can write scala code to implement building-related tasks and settings. This compiled code should go somewhere. It is located in the directory marked as TARGET 2 - project/target .
Build definitions in SBT can be recursive, i.e. your assembly definition may have its own assembly definition. Since you use plugins (defined in project/plugins.sbt ), defining your assembly requires an assembly definition, which ultimately boils down to project/project/target aka TARGET 1 in your diagram.
When you run clean in the SBT console, it will clear the files from the current target directory of the project. I do not think this means deleting the entire directory, but I could be wrong. In any case, running clean when the root project is selected should only affect the root target project.
In the SBT console, you can run reload plugins or reload return to go to (or) from (respectively) the current project assembly definition. Calling clean in this context will clear their corresponding target s.
As for combining them into one easily removable directory, I'm not sure I see the value in it. Using SBT for several years, various target dirs have never been in the way. I donβt think I even wanted to delete the target directory at a time in the last year or so.
Dylan source share