I'm working on a plugin for document generation. I'd like to output all generated files to a directory of my choosing. This directory, can be a subdirectory of SBT's target
directory, as follows:
val newTargetDirectory = SettingKey[File]("document-target-dir")
newTargetDirectory <<= target( _ / "new_output_folder")
If I cannot 'create' a File
object from this new setting, how do I utilise it?
Ordinarily, you don't "get the value of a setting", you make another setting or a task depend on your setting, which causes the configuration system to provide that other thing with the value at the appropriate time. The sections of the SBT wiki on "more about settings" and "custom settings and tasks" have a great deal of detail and many simple examples on this, especially the "Settings with dependencies" and "Tasks with dependencies" sections in the "more about" page.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With