Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Make --generated-module also apply to modules listed in exposed-modules

  • Loading branch information...
commit 3e4888ed5a959742f056910a858cad7bb04ea7b0 1 parent 42ec65e
lpotmann authored
13 Cabal/Distribution/Simple/SrcDist.hs
@@ -278,10 +278,17 @@ prepareTreeWithoutGeneratedModules verbosity pkg_descr0 mb_lbi distPref targetDi
278 278 installOrdinaryFile verbosity descFile (targetDir </> descFile)
279 279
280 280 where
281   - pkg_descr = mapAllBuildInfo filterGeneratedModules pkg_descr0
282   - filterGeneratedModules bi = bi {
283   - otherModules = filter (flip notElem generatedModules) (otherModules bi)
  281 + pkg_descr1 = mapAllBuildInfo filterGeneratedOtherModules pkg_descr0
  282 + pkg_descr = pkg_descr1 {
  283 + library = fmap filterGeneratedExposedModules (library pkg_descr1)
284 284 }
  285 + filterGeneratedOtherModules bi = bi {
  286 + otherModules = filterGeneratedModules (otherModules bi)
  287 + }
  288 + filterGeneratedExposedModules libr = libr {
  289 + exposedModules = filterGeneratedModules (exposedModules libr)
  290 + }
  291 + filterGeneratedModules = filter (flip notElem generatedModules)
285 292 -- Paths_<pkg>.hs, as well as the modules specified by the caller.
286 293 generatedModules = autogenModuleName pkg_descr0 : generatedModules0
287 294
2  Cabal/doc/installing-packages.markdown
Source Rendered
@@ -788,6 +788,8 @@ description file, and files named in the `license-file`, `main-is`,
788 788 If the package includes generated Haskell source files, they can be
789 789 excluded from the distribution on the command line. `Paths_`_pkgname_
790 790 does not need to be so specified; Cabal automatically knows to exclude it.
  791 +All the necessary scripts and data to re-generate the modules should be listed
  792 +in the `extra-source-files` field of the `.cabal` file.
791 793
792 794 This command takes the following option:
793 795

0 comments on commit 3e4888e

Please sign in to comment.
Something went wrong with that request. Please try again.