sirocchj/sbt-api-builder

Setting apiBuilderCLIConfigDirectory doesn't have any effect

Closed this issue · 5 comments

Setting apiBuilderCLIConfigDirectory doesn't have any effect

Thanks for reporting @jkenny !

The issue you're experiencing is due to lack ofuntested documentation, I fear.

That setting is scoped at Compile and Test configurations, hence the following will unblock your usecase:

Compile / apiBuilderCLIConfigDirectory := baseDirectory.value / ".apibuilder" // my config is at base_path/.apibuilder

I thought it would fall back to the Global configuration if no specific configuration was selected. I guess it's because you set fallbacks explicitly here?

It normally would fallback to delegates, see inspect apiBuilderCLIConfigDirectory in an sbt shell and here
However, in the code you linked I'm actually explicitly scoping that key to the value of Compile/sourceDirectory and Test/sourceDirectory (src/main and src/test, respectively). Hence to override those you need to scope them at same level at least

Makes sense. Thanks!

I see you updated the docs. Thanks :)