language-ninja-0.2.0: A library for dealing with the Ninja build language.

CopyrightCopyright 2017 Awake Security
LicenseApache-2.0
Maintaineropensource@awakesecurity.com
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Language.Ninja.IR.Rule0.1.0

Contents

Description

A datatype for Ninja rule declarations.

Synopsis

Rule

data Rule Source 0.1.0#

A Ninja rule declaration, as documented here.

Instances

Eq Rule  

Methods

(==) :: Rule -> Rule -> Bool #

(/=) :: Rule -> Rule -> Bool #

Ord Rule  

Methods

compare :: Rule -> Rule -> Ordering #

(<) :: Rule -> Rule -> Bool #

(<=) :: Rule -> Rule -> Bool #

(>) :: Rule -> Rule -> Bool #

(>=) :: Rule -> Rule -> Bool #

max :: Rule -> Rule -> Rule #

min :: Rule -> Rule -> Rule #

Show Rule  

Methods

showsPrec :: Int -> Rule -> ShowS #

show :: Rule -> String #

showList :: [Rule] -> ShowS #

Generic Rule  

Associated Types

type Rep Rule :: * -> * #

Methods

from :: Rule -> Rep Rule x #

to :: Rep Rule x -> Rule #

Hashable Rule

Default Hashable instance via Generic.0.1.0

Methods

hashWithSalt :: Int -> Rule -> Int #

hash :: Rule -> Int #

ToJSON Rule

Converts to {name: …, command: …, desc: …, pool: …, depfile: …, deps: …, generator: …, restat: …, rsp: …}.0.1.0

FromJSON Rule

Inverse of the ToJSON instance.0.1.0

NFData Rule

Default NFData instance via Generic.0.1.0

Methods

rnf :: Rule -> () #

(Monad m, Serial m Text) => Serial m Rule

Default Serial instance via Generic.0.1.0

Methods

series :: Series m Rule #

(Monad m, CoSerial m Text) => CoSerial m Rule

Default CoSerial instance via Generic.0.1.0

Methods

coseries :: Series m b -> Series m (Rule -> b) #

type Rep Rule  

makeRule Source 0.1.0#

Arguments

:: Text

The rule name.

-> Command

The command to run.

-> Rule

A rule that runs this command.

Construct an Rule with the given name and command, with default values for all other attributes (e.g.: False, Nothing, poolDefault).

ruleName :: Lens' Rule Text Source 0.1.0#

The name of the rule.

ruleCommand :: Lens' Rule Command Source 0.1.0#

The command that this rule will run.

ruleDescription :: Lens' Rule (Maybe Text) Source 0.1.0#

A short description of the command, used to pretty-print the command as it's running. The ninja -v flag controls whether to print the full command or its description; if a command fails, the full command line will always be printed before the command's output.

rulePool :: Lens' Rule PoolName Source 0.1.0#

The process pool in which this rule will be executed.

ruleDepfile :: Lens' Rule (Maybe Path) Source 0.1.0#

If set, this should be a path to an optional Makefile that contains extra implicit dependencies. This is used to support C/C++ header dependencies. For more information, read the Ninja documentation here.

ruleSpecialDeps :: Lens' Rule (Maybe SpecialDeps) Source 0.1.0#

If set, enables special dependency processing used in C/C++ header dependencies. For more information, read the Ninja documentation here.

ruleGenerator :: Lens' Rule Bool Source 0.1.0#

If this is true, specifies that this rule is used to re-invoke the generator program. Files built using generator rules are treated specially in two ways: firstly, they will not be rebuilt if the command line changes; and secondly, they are not cleaned by default.

ruleRestat :: Lens' Rule Bool Source 0.1.0#

If true, causes Ninja to re-stat the command's outputs after execution of the command. Each output whose modification time the command did not change will be treated as though it had never needed to be built. This may cause the output's reverse dependencies to be removed from the list of pending build actions.

ruleResponseFile :: Lens' Rule (Maybe ResponseFile) Source 0.1.0#

If present, Ninja will use a response file for the given command, i.e. write the selected string to the given file before calling the command and delete the file after the command is done.

This is particularly useful on Windows OS, where the maximal length of a command line is limited and response files must be used instead.

SpecialDeps

data SpecialDeps Source 0.1.0#

Special dependency information, as described here.

Instances

Eq SpecialDeps  
Ord SpecialDeps  
Read SpecialDeps  
Show SpecialDeps  
Generic SpecialDeps  

Associated Types

type Rep SpecialDeps :: * -> * #

Hashable SpecialDeps

Default Hashable instance via Generic.0.1.0

ToJSON SpecialDeps

Converts to {deps: "gcc"} or {deps: "msvc", prefix: …}.0.1.0

FromJSON SpecialDeps

Inverse of the ToJSON instance.0.1.0

NFData SpecialDeps

Default NFData instance via Generic.0.1.0

Methods

rnf :: SpecialDeps -> () #

(Monad m, Serial m Text) => Serial m SpecialDeps

Default Serial instance via Generic.0.1.0

(Monad m, CoSerial m Text) => CoSerial m SpecialDeps

Default CoSerial instance via Generic.0.1.0

Methods

coseries :: Series m b -> Series m (SpecialDeps -> b) #

type Rep SpecialDeps  
type Rep SpecialDeps = D1 (MetaData "SpecialDeps" "Language.Ninja.IR.Rule" "language-ninja-0.2.0-4aVVODOvkNMFxGcRpnztag" False) ((:+:) (C1 (MetaCons "SpecialDepsGCC" PrefixI False) U1) (C1 (MetaCons "SpecialDepsMSVC" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text))))

makeSpecialDepsGCC :: SpecialDeps Source 0.1.0#

Construct a SpecialDeps corresponding to the case in which deps = gcc is set in a Ninja build rule.

makeSpecialDepsMSVC :: Text -> SpecialDeps Source 0.1.0#

Construct a SpecialDeps corresponding to the case in which deps = msvc is set and msvc_deps_prefix = ….

The msvc_deps_prefix field defines the string which should be stripped from msvc's /showIncludes output. It is only needed if the version of Visual Studio being used is not English. The value of msvc_deps_prefix is "Note: including file: " by default.

_SpecialDepsGCC :: Prism' SpecialDeps () Source 0.1.0#

A prism for the deps = gcc case.

_SpecialDepsMSVC :: Prism' SpecialDeps Text Source 0.1.0#

A prism for the deps = msvc / msvc_deps_prefix = … case.

ResponseFile

data ResponseFile Source 0.1.0#

A response file to use during rule execution, as documented here.

Instances

Eq ResponseFile  
Ord ResponseFile  
Show ResponseFile  
Generic ResponseFile  

Associated Types

type Rep ResponseFile :: * -> * #

Hashable ResponseFile

Default Hashable instance via Generic.0.1.0

ToJSON ResponseFile

Converts to {path: …, content: …}.0.1.0

FromJSON ResponseFile

Inverse of the ToJSON instance.0.1.0

NFData ResponseFile

Default NFData instance via Generic.0.1.0

Methods

rnf :: ResponseFile -> () #

(Monad m, Serial m Text) => Serial m ResponseFile

Default Serial instance via Generic.0.1.0

(Monad m, CoSerial m Text) => CoSerial m ResponseFile

Default CoSerial instance via Generic.0.1.0

Methods

coseries :: Series m b -> Series m (ResponseFile -> b) #

type Rep ResponseFile  
type Rep ResponseFile = D1 (MetaData "ResponseFile" "Language.Ninja.IR.Rule" "language-ninja-0.2.0-4aVVODOvkNMFxGcRpnztag" False) (C1 (MetaCons "MkResponseFile" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "_responseFilePath") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Path)) (S1 (MetaSel (Just Symbol "_responseFileContent") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text))))

makeResponseFile Source 0.1.0#

Arguments

:: Path

Corresponds to rspfile.

-> Text

Corresponds to rspfile_content.

-> ResponseFile 

Construct a ResponseFile with the given Path and content Text.

responseFilePath :: Lens' ResponseFile Path Source 0.1.0#

A lens for the rspfile field.

responseFileContent :: Lens' ResponseFile Text Source 0.1.0#

A lens for the rspfile_content field.