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.Rule

Contents

Description

A datatype for Ninja rule declarations.

Since: 0.1.0

Synopsis

Rule

data Rule Source #

A Ninja rule declaration, as documented here.

Since: 0.1.0

Instances

Eq Rule Source # 

Methods

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

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

Ord Rule Source # 

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 Source # 

Methods

showsPrec :: Int -> Rule -> ShowS #

show :: Rule -> String #

showList :: [Rule] -> ShowS #

Generic Rule Source # 

Associated Types

type Rep Rule :: * -> * #

Methods

from :: Rule -> Rep Rule x #

to :: Rep Rule x -> Rule #

Hashable Rule Source #

Default Hashable instance via Generic.

Since: 0.1.0

Methods

hashWithSalt :: Int -> Rule -> Int #

hash :: Rule -> Int #

ToJSON Rule Source #

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

Since: 0.1.0

FromJSON Rule Source #

Inverse of the ToJSON instance.

Since: 0.1.0

NFData Rule Source #

Default NFData instance via Generic.

Since: 0.1.0

Methods

rnf :: Rule -> () #

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

Default Serial instance via Generic.

Since: 0.1.0

Methods

series :: Series m Rule #

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

Default CoSerial instance via Generic.

Since: 0.1.0

Methods

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

type Rep Rule Source # 

makeRule Source #

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).

Since: 0.1.0

ruleName :: Lens' Rule Text Source #

The name of the rule.

Since: 0.1.0

ruleCommand :: Lens' Rule Command Source #

The command that this rule will run.

Since: 0.1.0

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

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.

Since: 0.1.0

rulePool :: Lens' Rule PoolName Source #

The process pool in which this rule will be executed.

Since: 0.1.0

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

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.

Since: 0.1.0

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

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

Since: 0.1.0

ruleGenerator :: Lens' Rule Bool Source #

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.

Since: 0.1.0

ruleRestat :: Lens' Rule Bool Source #

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.

Since: 0.1.0

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

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.

Since: 0.1.0

SpecialDeps

data SpecialDeps Source #

Special dependency information, as described here.

Since: 0.1.0

Instances

Eq SpecialDeps Source # 
Ord SpecialDeps Source # 
Read SpecialDeps Source # 
Show SpecialDeps Source # 
Generic SpecialDeps Source # 

Associated Types

type Rep SpecialDeps :: * -> * #

Hashable SpecialDeps Source #

Default Hashable instance via Generic.

Since: 0.1.0

ToJSON SpecialDeps Source #

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

Since: 0.1.0

FromJSON SpecialDeps Source #

Inverse of the ToJSON instance.

Since: 0.1.0

NFData SpecialDeps Source #

Default NFData instance via Generic.

Since: 0.1.0

Methods

rnf :: SpecialDeps -> () #

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

Default Serial instance via Generic.

Since: 0.1.0

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

Default CoSerial instance via Generic.

Since: 0.1.0

Methods

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

type Rep SpecialDeps Source # 
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 #

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

Since: 0.1.0

makeSpecialDepsMSVC :: Text -> SpecialDeps Source #

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.

Since: 0.1.0

_SpecialDepsGCC :: Prism' SpecialDeps () Source #

A prism for the deps = gcc case.

Since: 0.1.0

_SpecialDepsMSVC :: Prism' SpecialDeps Text Source #

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

Since: 0.1.0

ResponseFile

data ResponseFile Source #

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

Since: 0.1.0

Instances

Eq ResponseFile Source # 
Ord ResponseFile Source # 
Show ResponseFile Source # 
Generic ResponseFile Source # 

Associated Types

type Rep ResponseFile :: * -> * #

Hashable ResponseFile Source #

Default Hashable instance via Generic.

Since: 0.1.0

ToJSON ResponseFile Source #

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

Since: 0.1.0

FromJSON ResponseFile Source #

Inverse of the ToJSON instance.

Since: 0.1.0

NFData ResponseFile Source #

Default NFData instance via Generic.

Since: 0.1.0

Methods

rnf :: ResponseFile -> () #

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

Default Serial instance via Generic.

Since: 0.1.0

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

Default CoSerial instance via Generic.

Since: 0.1.0

Methods

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

type Rep ResponseFile Source # 
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 #

Arguments

:: Path

Corresponds to rspfile.

-> Text

Corresponds to rspfile_content.

-> ResponseFile 

Construct a ResponseFile with the given Path and content Text.

Since: 0.1.0

responseFilePath :: Lens' ResponseFile Path Source #

A lens for the rspfile field.

Since: 0.1.0

responseFileContent :: Lens' ResponseFile Text Source #

A lens for the rspfile_content field.

Since: 0.1.0