{-# LANGUAGE TemplateHaskell #-}
module Futhark.Version
(
version
, versionString
)
where
import Data.Version
import Development.GitRev
import qualified Paths_futhark
version :: Version
version = Paths_futhark.version
versionString :: String
versionString = showVersion version ++ "\n" ++ gitversion
where
gitversion = concat ["git: "
, branch
, take 7 $(gitHash)
, " (", $(gitCommitDate), ")"
, dirty
]
branch | $(gitBranch) == "master" = ""
| otherwise = $(gitBranch) ++ " @ "
dirty | $(gitDirtyTracked) = " [modified]"
| otherwise = ""