@@ -136,10 +136,10 @@ data RebuildPolicy
137make :: forall m. (Functor m, Applicative m, Monad m, MonadReader Options m, MonadError MultipleErrors m, MonadWriter MultipleErrors m)
137make :: forall m. (Functor m, Applicative m, Monad m, MonadReader Options m, MonadError MultipleErrors m, MonadWriter MultipleErrors m)
138 => MakeActions m
138 => MakeActions m
139− -> [(Either RebuildPolicy FilePath, Module)]
139+ -> [Module]
140 -> m Environment
140 -> m Environment
141make MakeActions{..} ms = do
141make MakeActions{..} ms = do
142− (sorted, graph) <- sortModules $ map (importPrim . snd) ms
142+ (sorted, graph) <- sortModules $ map importPrim ms
143 mapM_ lint sorted
143 mapM_ lint sorted
144 toRebuild <- foldM (\s (Module _ moduleName' _ _) -> do
144 toRebuild <- foldM (\s (Module _ moduleName' _ _) -> do
145 inputTimestamp <- getInputTimestamp moduleName'
145 inputTimestamp <- getInputTimestamp moduleName'
@@ -282,6 +282,8 @@ buildMakeActions outputDir filePathMap foreigns usePrefix =
282 foreignFile = outputDir </> filePath </> "foreign.js"
282 foreignFile = outputDir </> filePath </> "foreign.js"
283 prefix = ["Generated by psc version " ++ showVersion Paths.version | usePrefix]
283 prefix = ["Generated by psc version " ++ showVersion Paths.version | usePrefix]
284 js = unlines $ map ("// " ++) prefix ++ [pjs]
284 js = unlines $ map ("// " ++) prefix ++ [pjs]
285+ verboseErrorsEnabled <- asks optionsVerboseErrors
286+ when verboseErrorsEnabled $ progress $ "Writing " ++ jsFile
285 writeTextFile jsFile js
287 writeTextFile jsFile js
286 maybe (return ()) (writeTextFile foreignFile . snd) $ mn `M.lookup` foreigns
288 maybe (return ()) (writeTextFile foreignFile . snd) $ mn `M.lookup` foreigns
287 writeTextFile externsFile exts
289 writeTextFile externsFile exts
@@ -295,16 +297,11 @@ buildMakeActions outputDir filePathMap foreigns usePrefix =
295 traverse (const $ getModificationTime path) $ guard exists
297 traverse (const $ getModificationTime path) $ guard exists
297 readTextFile :: FilePath -> Make String
299 readTextFile :: FilePath -> Make String
298− readTextFile path = do
299− verboseErrorsEnabled <- asks optionsVerboseErrors
300− makeIO (const (SimpleErrorWrapper $ CannotReadFile path)) $ do
300+ readTextFile path = makeIO (const (SimpleErrorWrapper $ CannotReadFile path)) $ readFile path
301− when verboseErrorsEnabled $ putStrLn $ "Reading " ++ path
304 writeTextFile :: FilePath -> String -> Make ()
302 writeTextFile :: FilePath -> String -> Make ()
305 writeTextFile path text = makeIO (const (SimpleErrorWrapper $ CannotWriteFile path)) $ do
303 writeTextFile path text = makeIO (const (SimpleErrorWrapper $ CannotWriteFile path)) $ do
306 mkdirp path
304 mkdirp path
307− putStrLn $ "Writing " ++ path
308 writeFile path text
305 writeFile path text
310 mkdirp :: FilePath -> IO ()
307 mkdirp :: FilePath -> IO ()