[Haskell-cafe] Building examples with Cabal
vogt.adam at gmail.com
Wed Oct 16 15:17:48 UTC 2013
Maybe your examples can be imported into a single module that cabal
can build/run with cabal test? I mean something like:
module Ex1 (main) where main = ...
module Main where
main = return ()
Then in the cabal file have something like:
<those other settings repeated once only>
On Wed, Oct 16, 2013 at 10:23 AM, Sven Panne <svenpanne at gmail.com> wrote:
> 2013/10/16 Heinrich Apfelmus <apfelmus at quantentunnel.de>:
>> I usually declare an "Executable" for each example and add a flag
>> "buildExamples" that controls whether the examples are built or not. Here an
>> example .cabal file.
> I tried something similar in the past, but that didn't really work out:
> * Things get *extremely* verbose and repetitive in the .cabal file.
> Currently there are roughly 90 GLUT examples, and I expect to have
> much more in the future. This would lead to more than 1000 lines of
> boilerplate .cabal stuff. OK, Emacs macros and copy-n-paste are your
> friends, but... :-P
> * Can Cabal build the executables in parallel? Doing a parallel
> build of all examples via my make hack takes about 5 seconds, a
> non-parallel build takes 75 seconds, and I expect that gap to widen
> even more when I add more examples.
> * How does one handle common parts in the examples? (e.g.
> more to come there) Conditionally build helper libraries just for the
> I can't believe that I'm the only package maintainer who has such a
> problem, so I really hope that there is some hidden solution out there
> I simply can't see...
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
More information about the Haskell-Cafe