Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
build.Artifact Class Reference
Inheritance diagram for build.Artifact:
build.Page build.Style

Public Member Functions

 __init__ (self, str output, Sequence[str] inputs)
 
bool depends_on (self, str path)
 
 build (self)
 

Static Public Member Functions

 build_all ()
 
 build_matching (Callable[[Artifact], bool] predicate)
 

Public Attributes

 output
 
 inputs
 

Static Public Attributes

dict all = {}
 
list listeners = []
 

Detailed Description

Represents a build artifact with its dependencies and way of building.

Definition at line 86 of file build.py.

Constructor & Destructor Documentation

◆ __init__()

build.Artifact.__init__ (   self,
str  output,
Sequence[str]  inputs 
)

Reimplemented in build.Page, and build.Style.

Definition at line 95 of file build.py.

95 def __init__(self, output: str, inputs: Sequence[str]):
96 Artifact.all[output] = self
97 self.output = output
98 self.inputs = [os.path.normpath(input) for input in inputs]
99

Member Function Documentation

◆ build()

build.Artifact.build (   self)
Convert artifact inputs into an output.

Reimplemented in build.Page, and build.Style.

Definition at line 104 of file build.py.

104 def build(self):
105 """Convert artifact inputs into an output."""
106
Definition build.py:1

◆ build_all()

build.Artifact.build_all ( )
static
Build all artifacts.

Definition at line 108 of file build.py.

108 def build_all():
109 """Build all artifacts."""
110 Artifact.build_matching(lambda obj: True)
111

◆ build_matching()

build.Artifact.build_matching ( Callable[[Artifact], bool]  predicate)
static
Build all artifacts matching the given filter.

Definition at line 113 of file build.py.

113 def build_matching(predicate: Callable[[Artifact], bool]):
114 """Build all artifacts matching the given filter."""
115 rebuilt = False
116 for _, artifact in Artifact.all.items():
117 if predicate(artifact):
118 artifact.build()
119 rebuilt = True
120
121 # If any artifacts were rebuilt notify the listeners.
122 if rebuilt:
123 for listener in Artifact.listeners:
124 listener()
125
126

◆ depends_on()

bool build.Artifact.depends_on (   self,
str  path 
)
Check if this

Reimplemented in build.Page, and build.Style.

Definition at line 100 of file build.py.

100 def depends_on(self, path: str) -> bool:
101 """Check if this"""
102 return path in self.inputs
103
static bool depends_on(GrRenderTask *depender, GrRenderTask *dependee)

Member Data Documentation

◆ all

dict build.Artifact.all = {}
static

Definition at line 90 of file build.py.

◆ inputs

build.Artifact.inputs

Definition at line 98 of file build.py.

◆ listeners

list build.Artifact.listeners = []
static

Definition at line 93 of file build.py.

◆ output

build.Artifact.output

Definition at line 97 of file build.py.


The documentation for this class was generated from the following file: