Flutter Engine
The Flutter Engine
third_party
dart-lang
sdk
tools
write_revision_file.py
Go to the documentation of this file.
1
#!/usr/bin/env python3
2
# Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
3
# for details. All rights reserved. Use of this source code is governed by a
4
# BSD-style license that can be found in the LICENSE file.
5
6
import
argparse
7
import
os
8
import
sys
9
import
utils
10
11
12
def
ParseArgs
(args):
13
args = args[1:]
14
parser = argparse.ArgumentParser(
15
description=
'A script to write the revision string to a file'
)
16
17
parser.add_argument(
18
'--output'
,
'-o'
, type=str, required=
True
, help=
'File to write'
)
19
parser.add_argument(
'--no-git-hash'
,
20
help=
'Omit the git hash in the output'
,
21
dest=
'no_git_hash'
,
22
action=
'store_true'
)
23
24
return
parser.parse_args(args)
25
26
27
def
Main
(argv):
28
args =
ParseArgs
(argv)
29
if
not
args.no_git_hash:
30
revision =
utils.GetGitRevision
()
31
else
:
32
revision =
''
33
if
revision
is
not
None
:
34
with
open(args.output,
'w'
)
as
f:
35
f.write(
'%s\n'
% revision)
36
return
0
37
38
39
if
__name__ ==
'__main__'
:
40
sys.exit(
Main
(sys.argv))
utils.GetGitRevision
def GetGitRevision(git_revision_file=None, repo_path=DART_DIR)
Definition:
utils.py:415
write_revision_file.Main
def Main(argv)
Definition:
write_revision_file.py:27
write_revision_file.ParseArgs
def ParseArgs(args)
Definition:
write_revision_file.py:12
Generated on Sun Jun 23 2024 21:55:52 for Flutter Engine by
1.9.4