This repository was archived by the owner on Feb 25, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +72
-0
lines changed Expand file tree Collapse file tree 5 files changed +72
-0
lines changed Original file line number Diff line number Diff line change @@ -142,3 +142,8 @@ app.*.symbols
142
142
143
143
# The gn-sdk from Chromium and managed by DEPS and gclient.
144
144
/tools /fuchsia /gn-sdk
145
+
146
+ # Git revision files created by gclient runhooks
147
+ engine.revision
148
+ dart.revision
149
+ skia.revision
Original file line number Diff line number Diff line change @@ -1236,5 +1236,41 @@ hooks = [
1236
1236
'--as-gclient-hook' ,
1237
1237
Var ('mac_sdk_min' )
1238
1238
]
1239
+ },
1240
+ {
1241
+ 'name' : 'Get Engine git revision' ,
1242
+ 'pattern' : '.' ,
1243
+ 'action' : [
1244
+ 'python3' ,
1245
+ 'src/flutter/build/git_revision.py' ,
1246
+ '--repository' ,
1247
+ 'src/flutter' ,
1248
+ '--output' ,
1249
+ 'src/flutter/engine.revision' ,
1250
+ ]
1251
+ },
1252
+ {
1253
+ 'name' : 'Get Skia git revision' ,
1254
+ 'pattern' : '.' ,
1255
+ 'action' : [
1256
+ 'python3' ,
1257
+ 'src/flutter/build/git_revision.py' ,
1258
+ '--repository' ,
1259
+ 'src/flutter/third_party/skia' ,
1260
+ '--output' ,
1261
+ 'src/flutter/skia.revision' ,
1262
+ ]
1263
+ },
1264
+ {
1265
+ 'name' : 'Get Dart git revision' ,
1266
+ 'pattern' : '.' ,
1267
+ 'action' : [
1268
+ 'python3' ,
1269
+ 'src/flutter/build/git_revision.py' ,
1270
+ '--repository' ,
1271
+ 'src/third_party/dart' ,
1272
+ '--output' ,
1273
+ 'src/flutter/dart.revision' ,
1274
+ ]
1239
1275
}
1240
1276
]
Original file line number Diff line number Diff line change @@ -42,10 +42,18 @@ def main():
42
42
parser .add_argument (
43
43
'--repository' , action = 'store' , help = 'Path to the Git repository.' , required = True
44
44
)
45
+ parser .add_argument (
46
+ '--output' , action = 'store' , help = 'Write revision to a file at this path instead of printing.'
47
+ )
45
48
46
49
args = parser .parse_args ()
47
50
repository = os .path .abspath (args .repository )
48
51
version = get_repository_version (repository )
52
+
53
+ if args .output :
54
+ with open (args .output , 'w' ) as file :
55
+ file .write (version .strip ())
56
+
49
57
print (version .strip ())
50
58
51
59
return 0
Original file line number Diff line number Diff line change @@ -344,6 +344,24 @@ def setup_apple_sdks():
344
344
return sdks_gn_args
345
345
346
346
347
+ def setup_git_versions():
348
+ revision_args = {}
349
+
350
+ engine_version_file = os.path.join(SRC_ROOT, 'flutter', 'engine.revision')
351
+ with open(engine_version_file, encoding='utf-8') as file:
352
+ revision_args['engine_version'] = file.read().strip()
353
+
354
+ skia_version_file = os.path.join(SRC_ROOT, 'flutter', 'skia.revision')
355
+ with open(skia_version_file, encoding='utf-8') as file:
356
+ revision_args['skia_version'] = file.read().strip()
357
+
358
+ dart_version_file = os.path.join(SRC_ROOT, 'flutter', 'dart.revision')
359
+ with open(dart_version_file, encoding='utf-8') as file:
360
+ revision_args['dart_version'] = file.read().strip()
361
+
362
+ return revision_args
363
+
364
+
347
365
def to_gn_args(args):
348
366
if args.simulator:
349
367
if args.target_os != 'ios':
@@ -355,6 +373,8 @@ def to_gn_args(args):
355
373
356
374
gn_args['is_debug'] = args.unoptimized
357
375
376
+ gn_args.update(setup_git_versions())
377
+
358
378
gn_args.update(setup_goma(args))
359
379
360
380
gn_args.update(setup_rbe(args))
Original file line number Diff line number Diff line change @@ -22,12 +22,15 @@ final Set<String> skippedPaths = <String>{
22
22
r'buildtools' , // only used by build
23
23
r'flutter/build' ,
24
24
r'flutter/ci' ,
25
+ r'flutter/dart.revision' , // only used by build
25
26
r'flutter/docs' ,
27
+ r'flutter/engine.revision' , // only used by build
26
28
r'flutter/flutter_frontend_server' ,
27
29
r'flutter/impeller/docs' ,
28
30
r'flutter/lib/web_ui/build' , // this is compiler-generated output
29
31
r'flutter/lib/web_ui/dev' , // these are build tools; they do not end up in Engine artifacts
30
32
r'flutter/prebuilts' ,
33
+ r'flutter/skia.revision' , // only used by build
31
34
r'flutter/sky/packages/sky_engine/LICENSE' ,
32
35
r'flutter/third_party/benchmark' , // only used by tests
33
36
r'flutter/third_party/boringssl/src/crypto/err/err_data_generate.go' ,
You can’t perform that action at this time.
0 commit comments