Copyright | (c) Benedikt Huber 2009 |
---|---|
License | BSD-like |
Maintainer | cabal-devel@haskell.org |
Stability | provisional |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Heuristics for creating initial cabal files.
Synopsis
- guessPackageName :: Interactive m => FilePath -> m PackageName
- guessMainFile :: Interactive m => FilePath -> m HsFilePath
- guessLicense :: Interactive m => InitFlags -> m SpecLicense
- guessExtraDocFiles :: Interactive m => InitFlags -> m (Maybe (Set FilePath))
- guessAuthorName :: Interactive m => m String
- guessAuthorEmail :: Interactive m => m String
- guessCabalSpecVersion :: Interactive m => m CabalSpecVersion
- guessLanguage :: Interactive m => Compiler -> m Language
- guessPackageType :: Interactive m => InitFlags -> m PackageType
- guessSourceDirectories :: Interactive m => InitFlags -> m [FilePath]
- guessApplicationDirectories :: Interactive m => InitFlags -> m [FilePath]
Documentation
guessPackageName :: Interactive m => FilePath -> m PackageName Source #
Guess the package name based on the given root directory.
guessMainFile :: Interactive m => FilePath -> m HsFilePath Source #
Guess the main file, returns a default value if none is found.
guessLicense :: Interactive m => InitFlags -> m SpecLicense Source #
Try to guess the license from an already existing LICENSE
file in
the package directory, comparing the file contents with the ones
listed in Licenses.hs
, for now it only returns a default value.
guessExtraDocFiles :: Interactive m => InitFlags -> m (Maybe (Set FilePath)) Source #
guessAuthorName :: Interactive m => m String Source #
Guess author and email using git configuration options.
guessAuthorEmail :: Interactive m => m String Source #
guessCabalSpecVersion :: Interactive m => m CabalSpecVersion Source #
Juggling characters around to guess the desired cabal version based on the system's cabal version.
guessLanguage :: Interactive m => Compiler -> m Language Source #
Guess the language specification based on the GHC version
guessPackageType :: Interactive m => InitFlags -> m PackageType Source #
Try to guess the package type from the files in the package directory, looking for unique characteristics from each type, defaults to Executable.
guessSourceDirectories :: Interactive m => InitFlags -> m [FilePath] Source #
Try to guess the source directories, using a default value as fallback.
guessApplicationDirectories :: Interactive m => InitFlags -> m [FilePath] Source #
Try to guess the application directories from the package directory, using a default value as fallback.