Commit 185af600 authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Move Shake files into _build/hadrian

parent 666f5c24
......@@ -16,8 +16,7 @@ module Base (
module Development.Shake.FilePath,
-- * Paths
shakeFilesPath, configPath, configFile, sourcePath, programInplacePath,
bootPackageConstraints, packageDependencies,
configPath, configFile, sourcePath, programInplacePath,
-- * Output
putColoured, putOracle, putBuild, putSuccess, putError,
......@@ -50,10 +49,6 @@ import System.IO
shakePath :: FilePath
shakePath = "hadrian"
-- TODO: Move to buildRootPath.
shakeFilesPath :: FilePath
shakeFilesPath = shakePath -/- ".db"
configPath :: FilePath
configPath = shakePath -/- "cfg"
......@@ -69,12 +64,6 @@ sourcePath = shakePath -/- "src"
programInplacePath :: FilePath
programInplacePath = "inplace/bin"
bootPackageConstraints :: FilePath
bootPackageConstraints = shakeFilesPath -/- "boot-package-constraints"
packageDependencies :: FilePath
packageDependencies = shakeFilesPath -/- "package-dependencies"
-- Utility functions
-- | Find and replace all occurrences of a value in a list
replaceEq :: Eq a => a -> a -> [a] -> [a]
......
......@@ -2,7 +2,6 @@ module Main (main) where
import Development.Shake
import qualified Base
import qualified CmdLineFlag
import qualified Environment
import qualified Rules
......@@ -10,6 +9,7 @@ import qualified Rules.Clean
import qualified Rules.Oracles
import qualified Rules.Selftest
import qualified Rules.Test
import qualified Settings.Paths
main :: IO ()
main = shakeArgsWith options CmdLineFlag.cmdFlags $ \cmdLineFlags targets -> do
......@@ -30,6 +30,6 @@ main = shakeArgsWith options CmdLineFlag.cmdFlags $ \cmdLineFlags targets -> do
options :: ShakeOptions
options = shakeOptions
{ shakeChange = ChangeModtimeAndDigest
, shakeFiles = Base.shakeFilesPath
, shakeFiles = Settings.Paths.shakeFilesPath
, shakeProgress = progressSimple
, shakeTimings = True }
{-# LANGUAGE DeriveDataTypeable, GeneralizedNewtypeDeriving #-}
module Oracles.PackageDeps (packageDeps, packageDepsOracle) where
import Base
import qualified Data.HashMap.Strict as Map
import Base
import Package
import Settings.Paths
newtype PackageDepsKey = PackageDepsKey PackageName
deriving (Show, Typeable, Eq, Hashable, Binary, NFData)
......
......@@ -17,7 +17,7 @@ clean dir = do
cleanRules :: Rules ()
cleanRules = do
"clean" ~> do
clean buildRootPath
forM_ [Stage0 ..] $ \stage -> clean (buildRootPath -/- stageString stage)
clean programInplacePath
clean "inplace/lib"
clean derivedConstantsPath
......@@ -29,6 +29,6 @@ cleanRules = do
forM_ [Stage0 ..] $ \stage -> do
let dir = pkgPath pkg -/- contextDirectory (vanillaContext stage pkg)
removeDirectoryIfExists dir
putBuild $ "| Remove the Shake database " ++ shakeFilesPath ++ "..."
removeFilesAfter shakeFilesPath ["//*"]
putBuild $ "| Remove Hadrian files..."
removeFilesAfter buildRootPath ["//*"]
putSuccess $ "| Done. "
module Settings.Paths (
contextDirectory, buildPath, pkgDataFile, pkgHaddockFile, pkgLibraryFile,
pkgLibraryFile0, pkgGhciLibraryFile, gmpBuildPath, gmpBuildInfoPath,
packageDbDirectory, pkgConfFile
packageDbDirectory, pkgConfFile, shakeFilesPath, bootPackageConstraints,
packageDependencies
) where
import Base
......@@ -16,6 +17,15 @@ import Settings.User
(~/~) :: FilePath -> FilePath -> FilePath
x ~/~ y = x ++ '/' : y
shakeFilesPath :: FilePath
shakeFilesPath = buildRootPath -/- "hadrian/shake-files"
bootPackageConstraints :: FilePath
bootPackageConstraints = shakeFilesPath -/- "boot-package-constraints"
packageDependencies :: FilePath
packageDependencies = shakeFilesPath -/- "package-dependencies"
-- | Path to the directory containing build artefacts of a given 'Context'.
buildPath :: Context -> FilePath
buildPath context@Context {..} =
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment