-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated doctest to use exact dependencies. removed upper bounds, new …
…build system, updated notification style
- Loading branch information
Showing
5 changed files
with
71 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,13 @@ | ||
dist | ||
TAGS | ||
tags | ||
docs | ||
wiki | ||
TAGS | ||
tags | ||
wip | ||
.DS_Store | ||
.*.swp | ||
.*.swo | ||
*.o | ||
*.hi | ||
*~ | ||
*# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
language: haskell | ||
# Use this when hackage is down. | ||
# before_install: | ||
# - mkdir -p ~/.cabal | ||
# - cp config ~/.cabal/config | ||
# - cabal update | ||
notifications: | ||
irc: "irc.freenode.org#haskell-lens" | ||
irc: | ||
channels: | ||
- "irc.freenode.org#haskell-lens" | ||
skip_join: true | ||
template: | ||
- "\x0313machines\x03/\x0306%{branch}\x03 \x0314%{commit}\x03 %{build_url} %{message}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,44 @@ | ||
#!/usr/bin/runhaskell | ||
> module Main (main) where | ||
\begin{code} | ||
{-# OPTIONS_GHC -Wall #-} | ||
module Main (main) where | ||
|
||
> import Distribution.Simple | ||
import Data.List ( nub ) | ||
import Data.Version ( showVersion ) | ||
import Distribution.Package ( PackageName(PackageName), PackageId, InstalledPackageId, packageVersion, packageName ) | ||
import Distribution.PackageDescription ( PackageDescription(), TestSuite(..) ) | ||
import Distribution.Simple ( defaultMainWithHooks, UserHooks(..), simpleUserHooks ) | ||
import Distribution.Simple.Utils ( rewriteFile, createDirectoryIfMissingVerbose ) | ||
import Distribution.Simple.BuildPaths ( autogenModulesDir ) | ||
import Distribution.Simple.Setup ( BuildFlags(buildVerbosity), fromFlag ) | ||
import Distribution.Simple.LocalBuildInfo ( withLibLBI, withTestLBI, LocalBuildInfo(), ComponentLocalBuildInfo(componentPackageDeps) ) | ||
import Distribution.Verbosity ( Verbosity ) | ||
import System.FilePath ( (</>) ) | ||
|
||
> main :: IO () | ||
> main = defaultMain | ||
main :: IO () | ||
main = defaultMainWithHooks simpleUserHooks | ||
{ buildHook = \pkg lbi hooks flags -> do | ||
generateBuildModule (fromFlag (buildVerbosity flags)) pkg lbi | ||
buildHook simpleUserHooks pkg lbi hooks flags | ||
} | ||
|
||
generateBuildModule :: Verbosity -> PackageDescription -> LocalBuildInfo -> IO () | ||
generateBuildModule verbosity pkg lbi = do | ||
let dir = autogenModulesDir lbi | ||
createDirectoryIfMissingVerbose verbosity True dir | ||
withLibLBI pkg lbi $ \_ libcfg -> do | ||
withTestLBI pkg lbi $ \suite suitecfg -> do | ||
rewriteFile (dir </> "Build_" ++ testName suite ++ ".hs") $ unlines | ||
[ "module Build_" ++ testName suite ++ " where" | ||
, "deps :: [String]" | ||
, "deps = " ++ (show $ formatdeps (testDeps libcfg suitecfg)) | ||
] | ||
where | ||
formatdeps = map (formatone . snd) | ||
formatone p = case packageName p of | ||
PackageName n -> n ++ "-" ++ showVersion (packageVersion p) | ||
|
||
testDeps :: ComponentLocalBuildInfo -> ComponentLocalBuildInfo -> [(InstalledPackageId, PackageId)] | ||
testDeps xs ys = nub $ componentPackageDeps xs ++ componentPackageDeps ys | ||
|
||
\end{code} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters