是否有 Haskell 模块用于将元数据编译到我的包中
Is there a Haskell module for compiling metadata into my packages
我已经成功地使用 GitHash module 将分支名称和提交哈希等内容烘焙到程序中。
是否有任何其他类似的模块以类似的方式从 package.yaml
中提取数据? (我想 TemplateHaskell 参与其中?)具体而言,目前,我对版本字符串感兴趣,但更广泛的解决方案可能非常有用。
有一个特殊的模块包含一个包自己的版本,除此之外:Paths_*pkgname*
(link to the relevant section of Cabal's documentation).
The Paths_pkgname
module also includes some other useful functions and values, which record the version of the package and some other directories which the package has been configured to be installed into (e.g. data files live in getDataDir
):
version :: Version
getBinDir :: IO FilePath
getLibDir :: IO FilePath
getDynLibDir :: IO FilePath
getDataDir :: IO FilePath
getLibexecDir :: IO FilePath
getSysconfDir :: IO FilePath
我已经成功地使用 GitHash module 将分支名称和提交哈希等内容烘焙到程序中。
是否有任何其他类似的模块以类似的方式从 package.yaml
中提取数据? (我想 TemplateHaskell 参与其中?)具体而言,目前,我对版本字符串感兴趣,但更广泛的解决方案可能非常有用。
有一个特殊的模块包含一个包自己的版本,除此之外:Paths_*pkgname*
(link to the relevant section of Cabal's documentation).
The
Paths_pkgname
module also includes some other useful functions and values, which record the version of the package and some other directories which the package has been configured to be installed into (e.g. data files live ingetDataDir
):version :: Version getBinDir :: IO FilePath getLibDir :: IO FilePath getDynLibDir :: IO FilePath getDataDir :: IO FilePath getLibexecDir :: IO FilePath getSysconfDir :: IO FilePath