module Rules.Clean (cleanRules) where

import Base
import Package
import Settings
import Settings.Path
import Stage
import UserSettings
import Util

cleanRules :: Rules ()
cleanRules = do
    "clean" ~> do
        forM_ [Stage0 ..] $ removeDirectory . (buildRootPath -/-) . stageString
        removeDirectory generatedPath
        removeDirectory programInplacePath
        removeDirectory "inplace/lib"
        removeDirectory "sdistprep"
        putBuild $ "| Remove files generated by ghc-cabal..."
        forM_ knownPackages $ \pkg ->
            forM_ [Stage0 ..] $ \stage ->
                quietly . removeDirectory $ pkgPath pkg -/- stageDirectory stage
        putBuild $ "| Remove Hadrian files..."
        removeFilesAfter buildRootPath ["//*"]
        putSuccess $ "| Done. "

module Rules.Clean (cleanRules) where

import Base
import Settings.Path
import Stage
import UserSettings
import Util

cleanRules :: Rules ()
cleanRules = do
    "clean" ~> do
        forM_ [Stage0 ..] $ removeDirectory . (buildRootPath -/-) . stageString
        removeDirectory generatedPath
        removeDirectory programInplacePath
        removeDirectory "inplace/lib"
        removeDirectory "sdistprep"
        putBuild $ "| Remove Hadrian files..."
        removeFilesAfter buildRootPath ["//*"]
        putSuccess $ "| Done. "

Drop redundant clean up after ghc-cabal
Drop redundant clean up after ghc-cabal

See #113
