sbt / sbt

sbt, the interactive build tool
https://scala-sbt.org
Apache License 2.0
4.81k stars 938 forks source link

Append output of dependencyTree `toFile` for multi-module projects #6627

Open saketjajoo opened 3 years ago

saketjajoo commented 3 years ago

Currently, there's an option to write the output of dependencyTree to a file using the toFile sub-command. This works fine for single-module projects. But for multi-module projects, this throws an error saying "Target file for dependencyTree already exists at <file_location>. Use '-f' to override".

If -f/--force is used, this overwrites the output in the existing file:

The data is written to file using the IO.write() method function. There's an option to append to file using a parameter called append: Boolean = false that is not used as of now. If this parameter is used (eg. IO.write(targetFile, data, IO.utf8, true)), then it would enable fetching of dependencies of all modules in a multi-module project.

cp-endor commented 7 months ago

I am hitting the same problem @saketjajoo were you able to find any workaround ?

mkurz commented 7 months ago

I think it shouldn't be that hard to implement a -a/--append flag, just as the force one. You want to work on that? Asking since I was experiencing the same problem...

mkurz commented 7 months ago

Related