Permalink
Browse files

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

  • Loading branch information...
1 parent 42ec65e commit 3e4888ed5a959742f056910a858cad7bb04ea7b0 @lpotmann committed Sep 21, 2012
Showing with 12 additions and 3 deletions.
  1. +10 −3 Cabal/Distribution/Simple/SrcDist.hs
  2. +2 −0 Cabal/doc/installing-packages.markdown
@@ -278,10 +278,17 @@ prepareTreeWithoutGeneratedModules verbosity pkg_descr0 mb_lbi distPref targetDi
installOrdinaryFile verbosity descFile (targetDir </> descFile)
where
- pkg_descr = mapAllBuildInfo filterGeneratedModules pkg_descr0
- filterGeneratedModules bi = bi {
- otherModules = filter (flip notElem generatedModules) (otherModules bi)
+ pkg_descr1 = mapAllBuildInfo filterGeneratedOtherModules pkg_descr0
+ pkg_descr = pkg_descr1 {
+ library = fmap filterGeneratedExposedModules (library pkg_descr1)
}
+ filterGeneratedOtherModules bi = bi {
+ otherModules = filterGeneratedModules (otherModules bi)
+ }
+ filterGeneratedExposedModules libr = libr {
+ exposedModules = filterGeneratedModules (exposedModules libr)
+ }
+ filterGeneratedModules = filter (flip notElem generatedModules)
-- Paths_<pkg>.hs, as well as the modules specified by the caller.
generatedModules = autogenModuleName pkg_descr0 : generatedModules0
@@ -788,6 +788,8 @@ description file, and files named in the `license-file`, `main-is`,
If the package includes generated Haskell source files, they can be
excluded from the distribution on the command line. `Paths_`_pkgname_
does not need to be so specified; Cabal automatically knows to exclude it.
+All the necessary scripts and data to re-generate the modules should be listed
+in the `extra-source-files` field of the `.cabal` file.
This command takes the following option:

0 comments on commit 3e4888e

Please sign in to comment.