Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add info on common stanzas to Quickstart module import section #5861

Merged
merged 1 commit into from
Jan 24, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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