7''' Interpolates build environment information into a file.
10from argparse
import ArgumentParser
11from datetime
import datetime
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')
26 return subprocess.check_output([
'git',
'-C',
GetDartPath(buildroot),
'rev-parse',
'HEAD']).strip()
30 project_root = path.join(buildroot,
'third_party',
'dart')
31 return subprocess.check_output([
'git',
'-C',
32 GetDartPath(buildroot),
'describe',
'--abbrev=0']).strip()
36 project_root = path.join(buildroot,
'flutter')
37 return subprocess.check_output([
'git',
'-C', project_root,
'rev-parse',
'HEAD']).strip()
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']
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)
53 '--buildroot', action=
'store', help=
'path to the flutter engine buildroot', required=
True
55 args = parser.parse_args()
58 with open(args.input,
'r')
as i, open(args.output,
'w')
as o:
61 '{{DART_SDK_GIT_REVISION}}',
64 '{{DART_SDK_SEMANTIC_VERSION}}',
67 '{{FLUTTER_ENGINE_GIT_REVISION}}',
73if __name__ ==
'__main__':
def GetFuchsiaSdkVersion(buildroot)
def GetFlutterEngineGitRevision(buildroot)
def GetDartSdkGitRevision(buildroot)
def GetDartSdkSemanticVersion(buildroot)
def GetDartPath(buildroot)
static DecodeResult decode(std::string path)