I'd like to organize my project into different libraries, since eventually I may be splitting some out to external repositories.
In a .cabal
file I can have multiple libraries (one unnamed, and multiple named, I believe):
library
import: servant-deps
exposed-modules:
App
other-modules:
Paths_cow_streamer
hs-source-dirs:
src
build-depends:
servant-server >= 0.15
library sxapi
import: servant-deps
exposed-modules:
SxClient
other-modules:
Paths_cow_streamer
hs-source-dirs:
sxapi
build-depends:
http-client
Initially I tried like this in my hpack package.yaml
:
library:
bar:
source-dirs:
- src
dependencies:
- servant-server >= 0.14
- wai
- warp
foo:
source-dirs:
- sxapi
dependencies:
- servant-server >= 0.14
- wai
- warp
But in this case, none of the entries seemed to be interpreted correctly, since e.g. source-dirs weren't present in the generated cabal file.
I also tried this, but unsurprisingly, one of the library definitions was overwritten:
library:
source-dirs:
- src
dependencies:
- servant-server >= 0.14
- wai
- warp
library:
source-dirs:
- sxapi
dependencies:
- servant-server >= 0.14
- wai
- warp
.cabal
file? Since when? – Fayefayette