Files
haskell.nix/test/project-flags/test-project-flags.cabal
Hamish Mackenzie f648a6585e Fix project flags (#253)
Project flags (from stack.yaml and plan.json) are exported in a modules attribute by stack-to-nix and plan-to-nix, but are not currently used. This change updates `mkStackPkgSet` and `mkCabalProjectPkgSet` so that the modules attribute is used (if present) and includes tests to check they are.

This commit makes `stdenv.lib.mkOverride` necessary for setting flags in `mkCabalProjectPkgSet` modules, however it also means that you can set them in `cabal.project` instead (see #254).
2019-10-11 17:19:31 +13:00

29 lines
792 B
Plaintext

cabal-version: >=1.10
name: test-project-flags
version: 0.1.0.0
license: PublicDomain
author: Hamish Mackenzie
maintainer: Hamish.Mackenzie@iohk.io
build-type: Simple
flag test-flag
description: A flag that needs to be turned on
default: False
library
build-depends: base >=4.7 && <5
exposed-modules: Lib
hs-source-dirs: src
default-language: Haskell2010
if flag(test-flag)
cpp-options: -DTEST_FLAG
executable test-project-flags-exe
main-is: Main.hs
build-depends: base >=4.7 && <5, test-project-flags
hs-source-dirs: app
ghc-options: -threaded -rtsopts -with-rtsopts=-N
default-language: Haskell2010
if flag(test-flag)
cpp-options: -DTEST_FLAG