Copyright | Copyright 2017 Awake Security |
---|---|
License | Apache-2.0 |
Maintainer | opensource@awakesecurity.com |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
Language.Ninja.IR.Rule0.1.0
Contents
Description
A datatype for Ninja rule
declarations.
- data Rule
- makeRule :: Text -> Command -> Rule
- ruleName :: Lens' Rule Text
- ruleCommand :: Lens' Rule Command
- ruleDescription :: Lens' Rule (Maybe Text)
- rulePool :: Lens' Rule PoolName
- ruleDepfile :: Lens' Rule (Maybe Path)
- ruleSpecialDeps :: Lens' Rule (Maybe SpecialDeps)
- ruleGenerator :: Lens' Rule Bool
- ruleRestat :: Lens' Rule Bool
- ruleResponseFile :: Lens' Rule (Maybe ResponseFile)
- data SpecialDeps
- makeSpecialDepsGCC :: SpecialDeps
- makeSpecialDepsMSVC :: Text -> SpecialDeps
- _SpecialDepsGCC :: Prism' SpecialDeps ()
- _SpecialDepsMSVC :: Prism' SpecialDeps Text
- data ResponseFile
- makeResponseFile :: Path -> Text -> ResponseFile
- responseFilePath :: Lens' ResponseFile Path
- responseFileContent :: Lens' ResponseFile Text
Rule
A Ninja rule
declaration, as documented
here.
Instances
Eq Rule | #Source | |
Ord Rule | #Source | |
Show Rule | #Source | |
Generic Rule | #Source | |
Hashable Rule | #Source | |
ToJSON Rule | #Source | Converts to
|
FromJSON Rule | #Source | Inverse of the |
NFData Rule | #Source | |
(Monad m, Serial m Text) => Serial m Rule | #Source | |
(Monad m, CoSerial m Text) => CoSerial m Rule | #Source | |
type Rep Rule | #Source | |
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.
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 | #Source | |
Ord SpecialDeps | #Source | |
Read SpecialDeps | #Source | |
Show SpecialDeps | #Source | |
Generic SpecialDeps | #Source | |
Hashable SpecialDeps | #Source | |
ToJSON SpecialDeps | #Source | Converts to |
FromJSON SpecialDeps | #Source | Inverse of the |
NFData SpecialDeps | #Source | |
(Monad m, Serial m Text) => Serial m SpecialDeps | #Source | |
(Monad m, CoSerial m Text) => CoSerial m SpecialDeps | #Source | |
type Rep SpecialDeps | #Source | |
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 | #Source | |
Ord ResponseFile | #Source | |
Show ResponseFile | #Source | |
Generic ResponseFile | #Source | |
Hashable ResponseFile | #Source | |
ToJSON ResponseFile | #Source | Converts to |
FromJSON ResponseFile | #Source | Inverse of the |
NFData ResponseFile | #Source | |
(Monad m, Serial m Text) => Serial m ResponseFile | #Source | |
(Monad m, CoSerial m Text) => CoSerial m ResponseFile | #Source | |
type Rep ResponseFile | #Source | |
makeResponseFile Source 0.1.0#
Arguments
:: Path | Corresponds to |
-> Text | Corresponds to |
-> 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.