ghc-make 0.3.2 → 0.3.3
raw patch · 6 files changed
+23/−13 lines, 6 filesdep ~shake
Dependency ranges changed: shake
Files
- CHANGES.txt +2/−0
- LICENSE +1/−1
- README.md +1/−1
- ghc-make.cabal +7/−6
- src/Main.hs +8/−3
- src/Makefile.hs +4/−2
CHANGES.txt view
@@ -1,5 +1,7 @@ Changelog for ghc-make +0.3.3+ Shake 0.16 compatibility 0.3.2 Shake 0.15 compatibility 0.3.1
LICENSE view
@@ -1,4 +1,4 @@-Copyright Neil Mitchell 2013-2015.+Copyright Neil Mitchell 2013-2017. All rights reserved. Redistribution and use in source and binary forms, with or without
README.md view
@@ -1,4 +1,4 @@-# ghc-make [](https://hackage.haskell.org/package/ghc-make) [](https://travis-ci.org/ndmitchell/ghc-make)+# ghc-make [](https://hackage.haskell.org/package/ghc-make) [](https://travis-ci.org/ndmitchell/ghc-make) An alternative to `ghc --make` which supports parallel compilation of modules and runs faster when nothing needs compiling.
ghc-make.cabal view
@@ -1,13 +1,13 @@-cabal-version: >= 1.8+cabal-version: >= 1.18 build-type: Simple name: ghc-make-version: 0.3.2+version: 0.3.3 license: BSD3 license-file: LICENSE category: Development author: Neil Mitchell <ndmitchell@gmail.com> maintainer: Neil Mitchell <ndmitchell@gmail.com>-copyright: Neil Mitchell 2013-2015+copyright: Neil Mitchell 2013-2017 synopsis: Accelerated version of ghc --make description: The @ghc-make@ program can be used as a drop-in replacement for @ghc@. This program@@ -22,10 +22,10 @@ See the readme for full details: <https://github.com/ndmitchell/ghc-make#readme>. homepage: https://github.com/ndmitchell/ghc-make#readme bug-reports: https://github.com/ndmitchell/ghc-make/issues-extra-source-files:+extra-doc-files: README.md CHANGES.txt-tested-with: GHC==7.10.1, GHC==7.8.3, GHC==7.6.3, GHC==7.4.2, GHC==7.2.2+tested-with: GHC==8.2.1, GHC==8.0.2, GHC==7.10.3, GHC==7.8.4, GHC==7.6.3, GHC==7.4.2 source-repository head type: git@@ -33,11 +33,12 @@ executable ghc-make main-is: Main.hs+ default-language: Haskell2010 ghc-options: -threaded hs-source-dirs: src build-depends: base == 4.*,- shake >= 0.14,+ shake >= 0.16, unordered-containers >= 0.2.1, process >= 1.0 other-modules:
src/Main.hs view
@@ -1,10 +1,12 @@ {-# LANGUAGE RecordWildCards, DeriveDataTypeable, GeneralizedNewtypeDeriving, ScopedTypeVariables #-}+{-# LANGUAGE TypeFamilies #-} module Main(main) where import Control.Monad import Data.Either import Data.Maybe+import Data.Functor import Development.Shake import Development.Shake.Classes import Development.Shake.FilePath@@ -14,6 +16,7 @@ import qualified Data.HashMap.Strict as Map import Arguments import Makefile+import Prelude -- | Increment every time I change the rules in an incompatible way@@ -22,8 +25,10 @@ newtype AskImports = AskImports Module deriving (Show,Typeable,Eq,Hashable,Binary,NFData)+type instance RuleResult AskImports = [Either FilePath Module] newtype AskSource = AskSource Module deriving (Show,Typeable,Eq,Hashable,Binary,NFData)+type instance RuleResult AskSource = String main :: IO ()@@ -45,14 +50,14 @@ prefix <.> "args" %> \out -> do alwaysRerun writeFileChanged out $ unlines argsGHC- needArgs <- return $ do need [prefix <.> "args"]; return argsGHC+ let needArgs = do need [prefix <.> "args"]; return argsGHC -- A file containing the ghc-pkg list output prefix <.> "pkgs" %> \out -> do alwaysRerun (Stdout s, Stderr (_ :: String)) <- cmd "ghc-pkg list --verbose" writeFileChanged out s- needPkgs <- return $ need [prefix <.> "pkgs"]+ let needPkgs = need [prefix <.> "pkgs"] -- A file containing the output of -M prefix <.> "makefile" %> \out -> do@@ -97,7 +102,7 @@ match &?> \[o,hi] -> do let Just m = oModule o source <- askSource (AskSource m)- (files,mods) <- fmap partitionEithers $ askImports (AskImports m)+ (files,mods) <- partitionEithers <$> askImports (AskImports m) need $ source : map hiFile mods ++ files when (threads /= 1) $ do args <- needArgs
src/Makefile.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE RecordWildCards, PatternGuards, DeriveDataTypeable #-}+{-# LANGUAGE PatternGuards, DeriveDataTypeable #-} module Makefile(Makefile(..), Module(..), makefile) where @@ -7,7 +7,9 @@ import Development.Shake.Classes import Development.Shake.Util import Data.Bits+import Data.Functor import qualified Data.HashMap.Strict as Map+import Prelude data Module = Module {moduleName :: [String], moduleBoot :: Bool}@@ -34,7 +36,7 @@ makefile :: FilePath -> IO Makefile-makefile file = fmap (foldl' f z . parseMakefile) $ readFile file+makefile file = foldl' f z . parseMakefile <$> readFile file where z = Makefile Map.empty Map.empty