Commit 010fb8c1 authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Drop unused Resources parameter.

parent a10669a6
......@@ -55,19 +55,16 @@ packageRules :: Rules ()
packageRules = do
resources <- Rules.Resources.resourceRules
for_ allStages $ \stage ->
for_ knownPackages $ \pkg ->
buildPackage resources $ vanillaContext stage pkg
buildPackage :: Rules.Resources.Resources -> Context -> Rules ()
buildPackage = mconcat
[ Rules.Compile.compilePackage
, Rules.Data.buildPackageData
, Rules.Dependencies.buildPackageDependencies
, Rules.Documentation.buildPackageDocumentation
, Rules.Generate.generatePackageCode
, Rules.Library.buildPackageLibrary
, Rules.Program.buildProgram
, Rules.Register.registerPackage ]
for_ knownPackages $ \package -> do
let context = vanillaContext stage package
Rules.Compile.compilePackage resources context
Rules.Data.buildPackageData context
Rules.Dependencies.buildPackageDependencies resources context
Rules.Documentation.buildPackageDocumentation context
Rules.Generate.generatePackageCode context
Rules.Library.buildPackageLibrary context
Rules.Program.buildProgram context
Rules.Register.registerPackage resources context
buildRules :: Rules ()
buildRules = mconcat
......
......@@ -12,14 +12,13 @@ import Oracles.PackageDeps
import Rules.Actions
import Rules.Generate
import Rules.Libffi
import Rules.Resources
import Settings
import Settings.Builders.Common
import Target
-- Build package-data.mk by using GhcCabal to process pkgCabal file
buildPackageData :: Resources -> Context -> Rules ()
buildPackageData _ context @ (Context {..}) = do
buildPackageData :: Context -> Rules ()
buildPackageData context @ (Context {..}) = do
let cabalFile = pkgCabalFile package
configure = pkgPath package -/- "configure"
dataFile = pkgDataFile stage package
......
......@@ -7,7 +7,6 @@ import Expression
import GHC
import Oracles.PackageData
import Rules.Actions
import Rules.Resources
import Settings
import Target
......@@ -17,8 +16,8 @@ haddockHtmlLib = "inplace/lib/html/haddock-util.js"
-- Note: this build rule creates plenty of files, not just the .haddock one.
-- All of them go into the 'doc' subdirectory. Pedantically tracking all built
-- files in the Shake databases seems fragile and unnecesarry.
buildPackageDocumentation :: Resources -> Context -> Rules ()
buildPackageDocumentation _ context @ (Context {..}) =
buildPackageDocumentation :: Context -> Rules ()
buildPackageDocumentation context @ (Context {..}) =
let cabalFile = pkgCabalFile package
haddockFile = pkgHaddockFile package
in when (stage == Stage1) $ do
......
......@@ -20,7 +20,6 @@ import Oracles.ModuleFiles
import Rules.Actions
import Rules.Gmp
import Rules.Libffi
import Rules.Resources (Resources)
import Settings
import Target hiding (builder, context)
......@@ -114,8 +113,8 @@ generate file context expr = do
writeFileChanged file contents
putSuccess $ "| Successfully generated '" ++ file ++ "'."
generatePackageCode :: Resources -> Context -> Rules ()
generatePackageCode _ context @ (Context stage pkg _) =
generatePackageCode :: Context -> Rules ()
generatePackageCode context @ (Context stage pkg _) =
let buildPath = targetPath stage pkg -/- "build"
dropBuild = drop (length buildPath + 1)
generated f = (buildPath ++ "//*.hs") ?== f && not ("//autogen/*" ?== f)
......
......@@ -11,13 +11,12 @@ import GHC
import Oracles.PackageData
import Rules.Actions
import Rules.Gmp
import Rules.Resources
import Settings
import Target
-- TODO: Use way from Context, #207
buildPackageLibrary :: Resources -> Context -> Rules ()
buildPackageLibrary _ context @ (Context {..}) = do
buildPackageLibrary :: Context -> Rules ()
buildPackageLibrary context @ (Context {..}) = do
let buildPath = targetPath stage package -/- "build"
-- TODO: handle dynamic libraries
......
......@@ -11,7 +11,6 @@ import Oracles.Config.Setting
import Oracles.PackageData
import Rules.Actions
import Rules.Library
import Rules.Resources
import Rules.Wrappers.Ghc
import Rules.Wrappers.GhcPkg
import Settings
......@@ -32,8 +31,8 @@ wrappers = [ (vanillaContext Stage0 ghc , ghcWrapper )
, (vanillaContext Stage1 ghc , ghcWrapper )
, (vanillaContext Stage0 ghcPkg, ghcPkgWrapper)]
buildProgram :: Resources -> Context -> Rules ()
buildProgram _ context @ (Context {..}) = do
buildProgram :: Context -> Rules ()
buildProgram context @ (Context {..}) = do
let match file = case programPath stage package of
Nothing -> False
Just program -> program == file
......
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