Skip to content

Commit

Permalink
Merge pull request #5861 from m-renaud/mrenaud-docs-common-in-quickstart
Browse files Browse the repository at this point in the history
Add info on common stanzas to Quickstart module import section

(cherry picked from commit e388548)
  • Loading branch information
23Skidoo committed Jan 25, 2019
1 parent 95019a6 commit 5c7eea0
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions Cabal/doc/developing-packages.rst
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,27 @@ The last is just shorthand, for example ``base == 4.*`` means exactly
the same thing as ``base >= 4 && < 5``. Please refer to the documentation
on the :pkg-field:`build-depends` field for more information.

Also, you can factor out shared ``build-depends`` (and other fields such
as ``ghc-options``) into a ``common`` stanza which you can ``import`` in
your libraries and executable sections. For example:

::

common shared-properties
default-language: Haskell2010
build-depends:
base == 4.*
ghc-options:
-Wall

library
import: shared-properties
exposed-modules:
Proglet

Note that the ``import`` **must** be the first thing in the stanza. For more
information see the `Common stanzas`_ section.

Building the package
--------------------

Expand Down

0 comments on commit 5c7eea0

Please sign in to comment.