Flutter Engine
The Flutter Engine
Functions
make_build_info Namespace Reference

Functions

def GetDartPath (buildroot)
 
def GetDartSdkGitRevision (buildroot)
 
def GetDartSdkSemanticVersion (buildroot)
 
def GetFlutterEngineGitRevision (buildroot)
 
def GetFuchsiaSdkVersion (buildroot)
 
def main ()
 

Function Documentation

◆ GetDartPath()

def make_build_info.GetDartPath (   buildroot)

Definition at line 18 of file make_build_info.py.

18def GetDartPath(buildroot):
19 dart_path = path.join(buildroot, 'flutter', 'third_party', 'dart')
20 if not path.exists(dart_path):
21 dart_path = path.join(buildroot, 'third_party', 'dart')
22 return dart_path
23
24
def GetDartPath(buildroot)

◆ GetDartSdkGitRevision()

def make_build_info.GetDartSdkGitRevision (   buildroot)

Definition at line 25 of file make_build_info.py.

25def GetDartSdkGitRevision(buildroot):
26 return subprocess.check_output(['git', '-C', GetDartPath(buildroot), 'rev-parse', 'HEAD']).strip()
27
28
def GetDartSdkGitRevision(buildroot)

◆ GetDartSdkSemanticVersion()

def make_build_info.GetDartSdkSemanticVersion (   buildroot)

Definition at line 29 of file make_build_info.py.

29def GetDartSdkSemanticVersion(buildroot):
30 project_root = path.join(buildroot, 'third_party', 'dart')
31 return subprocess.check_output(['git', '-C',
32 GetDartPath(buildroot), 'describe', '--abbrev=0']).strip()
33
34
def GetDartSdkSemanticVersion(buildroot)

◆ GetFlutterEngineGitRevision()

def make_build_info.GetFlutterEngineGitRevision (   buildroot)

Definition at line 35 of file make_build_info.py.

35def GetFlutterEngineGitRevision(buildroot):
36 project_root = path.join(buildroot, 'flutter')
37 return subprocess.check_output(['git', '-C', project_root, 'rev-parse', 'HEAD']).strip()
38
39
def GetFlutterEngineGitRevision(buildroot)

◆ GetFuchsiaSdkVersion()

def make_build_info.GetFuchsiaSdkVersion (   buildroot)

Definition at line 40 of file make_build_info.py.

40def GetFuchsiaSdkVersion(buildroot):
41 with open(path.join(buildroot, 'fuchsia', 'sdk',
42 'linux' if sys.platform.startswith('linux') else 'mac', 'meta',
43 'manifest.json'), 'r') as fuchsia_sdk_manifest:
44 return json.load(fuchsia_sdk_manifest)['id']
45
46
def GetFuchsiaSdkVersion(buildroot)

◆ main()

def make_build_info.main ( )

Definition at line 47 of file make_build_info.py.

47def main():
48 # Parse arguments.
49 parser = ArgumentParser()
50 parser.add_argument('--input', action='store', help='input file path', required=True)
51 parser.add_argument('--output', action='store', help='output file path', required=True)
52 parser.add_argument(
53 '--buildroot', action='store', help='path to the flutter engine buildroot', required=True
54 )
55 args = parser.parse_args()
56
57 # Read, interpolate, write.
58 with open(args.input, 'r') as i, open(args.output, 'w') as o:
59 o.write(
60 i.read().replace(
61 '{{DART_SDK_GIT_REVISION}}',
62 GetDartSdkGitRevision(args.buildroot).decode('utf-8')
63 ).replace(
64 '{{DART_SDK_SEMANTIC_VERSION}}',
65 GetDartSdkSemanticVersion(args.buildroot).decode('utf-8')
66 ).replace(
67 '{{FLUTTER_ENGINE_GIT_REVISION}}',
68 GetFlutterEngineGitRevision(args.buildroot).decode('utf-8')
69 ).replace('{{FUCHSIA_SDK_VERSION}}', GetFuchsiaSdkVersion(args.buildroot))
70 )
71
72
static DecodeResult decode(std::string path)
Definition: png_codec.cpp:124