Commit 8d31f43b authored by Edward Z. Yang's avatar Edward Z. Yang
Browse files

Rename .cabal required-signatures field to signatures

Change of .cabal file syntax: rename @required-signatures@ field to
just @signatures@. Update the parser and error messages that mention
the field.

Also rename the corresponding field in the Library type.
parent 3de0e4c4
......@@ -241,11 +241,11 @@ checkLibrary pkg lib =
Just n -> n
) ++ "does not expose any modules"
-- check use of required-signatures/exposed-signatures sections
, checkVersion [1,21] (not (null (requiredSignatures lib))) $
-- check use of signatures sections
, checkVersion [1,25] (not (null (signatures lib))) $
PackageDistInexcusable $
"To use the 'required-signatures' field the package needs to specify "
++ "at least 'cabal-version: >= 1.21'."
"To use the 'signatures' field the package needs to specify "
++ "at least 'cabal-version: >= 1.25'."
-- check that all autogen-modules appear on other-modules or exposed-modules
, check
......
......@@ -177,8 +177,8 @@ libFieldDescrs =
, commaListFieldWithSep vcat "reexported-modules" disp parse
reexportedModules (\mods lib -> lib{reexportedModules=mods})
, listFieldWithSep vcat "required-signatures" disp parseModuleNameQ
requiredSignatures (\mods lib -> lib{requiredSignatures=mods})
, listFieldWithSep vcat "signatures" disp parseModuleNameQ
signatures (\mods lib -> lib{signatures=mods})
, boolField "exposed"
libExposed (\val lib -> lib{libExposed=val})
......
......@@ -416,7 +416,7 @@ testSuiteLibV09AsLibAndExe pkg_descr
libName = Nothing,
exposedModules = [ m ],
reexportedModules = [],
requiredSignatures = [],
signatures = [],
libExposed = True,
libBuildInfo = bi
}
......
......@@ -20,7 +20,7 @@ data Library = Library {
libName :: Maybe String,
exposedModules :: [ModuleName],
reexportedModules :: [ModuleReexport],
requiredSignatures:: [ModuleName], -- ^ What sigs need implementations?
signatures:: [ModuleName], -- ^ What sigs need implementations?
libExposed :: Bool, -- ^ Is the lib to be exposed by default?
libBuildInfo :: BuildInfo
}
......@@ -33,7 +33,7 @@ instance Monoid Library where
libName = mempty,
exposedModules = mempty,
reexportedModules = mempty,
requiredSignatures = mempty,
signatures = mempty,
libExposed = True,
libBuildInfo = mempty
}
......@@ -44,7 +44,7 @@ instance Semigroup Library where
libName = combine libName,
exposedModules = combine exposedModules,
reexportedModules = combine reexportedModules,
requiredSignatures = combine requiredSignatures,
signatures = combine signatures,
libExposed = libExposed a && libExposed b, -- so False propagates
libBuildInfo = combine libBuildInfo
}
......@@ -61,7 +61,7 @@ emptyLibrary = mempty
explicitLibModules :: Library -> [ModuleName]
explicitLibModules lib = exposedModules lib
++ otherModules (libBuildInfo lib)
++ requiredSignatures lib
++ signatures lib
-- | Get all the auto generated module names from the library, exposed or not.
-- This are a subset of 'libModules'.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment