Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 07bce06

Browse files
authored
Merge branch 'main' into engine-dir-contents-diff-tests
2 parents c625dd7 + db49661 commit 07bce06

File tree

161 files changed

+1724
-1592
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

161 files changed

+1724
-1592
lines changed

DEPS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,7 +1000,7 @@ deps = {
10001000
'packages': [
10011001
{
10021002
'package': 'fuchsia/sdk/core/linux-amd64',
1003-
'version': 'gKg6HlBeR52y-cMhu1lFKv7wxHoEM8Nw-b_pWokiVAkC'
1003+
'version': 'dLhvv964txwnSlvNw-qiuPtzH97grhOfLDOeg3QQKucC'
10041004
}
10051005
],
10061006
'condition': 'host_os == "linux" and not download_fuchsia_sdk',
@@ -1019,7 +1019,7 @@ deps = {
10191019
},
10201020

10211021
'src/third_party/impeller-cmake-example': {
1022-
'url': Var('flutter_git') + '/third_party/impeller-cmake-example.git' + '@' + 'd1a26a51dc6890e5f851749e3d8e048703f24f51',
1022+
'url': Var('flutter_git') + '/third_party/impeller-cmake-example.git' + '@' + 'c44e8093972c969acf171be72591e408a85fdc53',
10231023
'condition': 'download_impeller_cmake_example',
10241024
},
10251025

build/copy_info_plist.py

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@
2323

2424
def get_clang_version():
2525
clang_executable = str(
26-
os.path.join(
27-
'..', '..', 'buildtools', 'mac-x64', 'clang', 'bin', 'clang++'
28-
)
26+
os.path.join('..', '..', 'buildtools', 'mac-x64', 'clang', 'bin', 'clang++')
2927
)
3028
version = subprocess.check_output([clang_executable, '--version'])
3129
return version.splitlines()[0]
@@ -39,32 +37,20 @@ def main():
3937
)
4038

4139
parser.add_argument(
42-
'--source',
43-
help='Path to Info.plist source template',
44-
type=str,
45-
required=True
40+
'--source', help='Path to Info.plist source template', type=str, required=True
4641
)
4742
parser.add_argument(
48-
'--destination',
49-
help='Path to destination Info.plist',
50-
type=str,
51-
required=True
52-
)
53-
parser.add_argument(
54-
'--minversion', help='Minimum device OS version like "9.0"', type=str
43+
'--destination', help='Path to destination Info.plist', type=str, required=True
5544
)
45+
parser.add_argument('--minversion', help='Minimum device OS version like "9.0"', type=str)
5646

5747
args = parser.parse_args()
5848

5949
text = open(args.source).read()
6050
engine_path = os.path.join(os.getcwd(), '..', '..', 'flutter')
6151
revision = git_revision.get_repository_version(engine_path)
6252
clang_version = get_clang_version()
63-
text = text.format(
64-
revision=revision,
65-
clang_version=clang_version,
66-
min_version=args.minversion
67-
)
53+
text = text.format(revision=revision, clang_version=clang_version, min_version=args.minversion)
6854

6955
with open(args.destination, 'w') as outfile:
7056
outfile.write(text)

build/dart/tools/dart_pkg.py

Lines changed: 9 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@
1616

1717
USE_LINKS = sys.platform != 'win32'
1818

19-
DART_ANALYZE = os.path.join(
20-
os.path.dirname(os.path.abspath(__file__)), 'dart_analyze.py'
21-
)
19+
DART_ANALYZE = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'dart_analyze.py')
2220

2321

2422
def dart_filter(path):
@@ -164,10 +162,7 @@ def analyze_entrypoints(dart_sdk, package_root, entrypoints):
164162
def main():
165163
parser = argparse.ArgumentParser(description='Generate a dart-pkg')
166164
parser.add_argument(
167-
'--dart-sdk',
168-
action='store',
169-
metavar='dart_sdk',
170-
help='Path to the Dart SDK.'
165+
'--dart-sdk', action='store', metavar='dart_sdk', help='Path to the Dart SDK.'
171166
)
172167
parser.add_argument(
173168
'--package-name',
@@ -183,28 +178,14 @@ def main():
183178
required=True
184179
)
185180
parser.add_argument(
186-
'--package-root',
187-
metavar='package_root',
188-
help='packages/ directory',
189-
required=True
190-
)
191-
parser.add_argument(
192-
'--stamp-file',
193-
metavar='stamp_file',
194-
help='timestamp file',
195-
required=True
181+
'--package-root', metavar='package_root', help='packages/ directory', required=True
196182
)
183+
parser.add_argument('--stamp-file', metavar='stamp_file', help='timestamp file', required=True)
197184
parser.add_argument(
198-
'--entries-file',
199-
metavar='entries_file',
200-
help='script entries file',
201-
required=True
185+
'--entries-file', metavar='entries_file', help='script entries file', required=True
202186
)
203187
parser.add_argument(
204-
'--package-sources',
205-
metavar='package_sources',
206-
help='Package sources',
207-
nargs='+'
188+
'--package-sources', metavar='package_sources', help='Package sources', nargs='+'
208189
)
209190
parser.add_argument(
210191
'--package-entrypoints',
@@ -259,16 +240,12 @@ def main():
259240
sdkext_path = os.path.join(lib_path, '_sdkext')
260241
if mappings:
261242
with open(sdkext_path, 'w') as stream:
262-
json.dump(
263-
mappings, stream, sort_keys=True, indent=2, separators=(',', ': ')
264-
)
243+
json.dump(mappings, stream, sort_keys=True, indent=2, separators=(',', ': '))
265244
else:
266245
remove_if_exists(sdkext_path)
267246

268247
# Copy or symlink package sources into pkg directory.
269-
common_source_prefix = os.path.dirname(
270-
os.path.commonprefix(args.package_sources)
271-
)
248+
common_source_prefix = os.path.dirname(os.path.commonprefix(args.package_sources))
272249
for source in args.package_sources:
273250
relative_source = os.path.relpath(source, common_source_prefix)
274251
target = os.path.join(target_dir, relative_source)
@@ -291,9 +268,7 @@ def main():
291268
target = os.path.join(sdk_ext_dir, relative_source)
292269
copy_or_link(source, target)
293270

294-
common_source_prefix = os.path.dirname(
295-
os.path.commonprefix(args.sdk_ext_files)
296-
)
271+
common_source_prefix = os.path.dirname(os.path.commonprefix(args.sdk_ext_files))
297272
for source in args.sdk_ext_files:
298273
relative_source = os.path.relpath(source, common_source_prefix)
299274
target = os.path.join(sdk_ext_dir, relative_source)

build/generate_coverage.py

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,15 @@
1313

1414

1515
def get_llvm_bin_directory():
16-
buildtool_dir = os.path.join(
17-
os.path.dirname(os.path.realpath(__file__)), '../../buildtools'
18-
)
16+
buildtool_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../buildtools')
1917
platform_dir = ''
2018
if sys.platform.startswith('linux'):
2119
platform_dir = 'linux-x64'
2220
elif sys.platform == 'darwin':
2321
platform_dir = 'mac-x64'
2422
else:
2523
raise Exception('Unknown/Unsupported platform.')
26-
llvm_bin_dir = os.path.abspath(
27-
os.path.join(buildtool_dir, platform_dir, 'clang/bin')
28-
)
24+
llvm_bin_dir = os.path.abspath(os.path.join(buildtool_dir, platform_dir, 'clang/bin'))
2925
if not os.path.exists(llvm_bin_dir):
3026
raise Exception('LLVM directory %s double not be located.' % llvm_bin_dir)
3127
return llvm_bin_dir
@@ -61,9 +57,7 @@ def collect_profiles(args):
6157
print('Path %s does not exist.' % absolute_test_path)
6258
return -1
6359

64-
unstripped_test_path = os.path.join(
65-
absolute_test_dir, 'exe.unstripped', test_name
66-
)
60+
unstripped_test_path = os.path.join(absolute_test_dir, 'exe.unstripped', test_name)
6761

6862
if os.path.exists(unstripped_test_path):
6963
binaries.append(unstripped_test_path)
@@ -74,10 +68,7 @@ def collect_profiles(args):
7468

7569
remove_if_exists(raw_profile)
7670

77-
print(
78-
'Running test %s to gather profile.' %
79-
os.path.basename(absolute_test_path)
80-
)
71+
print('Running test %s to gather profile.' % os.path.basename(absolute_test_path))
8172

8273
test_command = [absolute_test_path]
8374

@@ -105,8 +96,7 @@ def merge_profiles(llvm_bin_dir, raw_profiles, output):
10596
print('Merging %d raw profile(s) into single profile.' % len(raw_profiles))
10697
merged_profile_path = os.path.join(output, 'all.profile')
10798
remove_if_exists(merged_profile_path)
108-
merge_command = [profdata_binary, 'merge', '-sparse'
109-
] + raw_profiles + ['-o', merged_profile_path]
99+
merge_command = [profdata_binary, 'merge', '-sparse'] + raw_profiles + ['-o', merged_profile_path]
110100
subprocess.check_call(merge_command)
111101
print('Done.')
112102
return merged_profile_path

build/git_revision.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,7 @@ def main():
4040
parser = argparse.ArgumentParser()
4141

4242
parser.add_argument(
43-
'--repository',
44-
action='store',
45-
help='Path to the Git repository.',
46-
required=True
43+
'--repository', action='store', help='Path to the Git repository.', required=True
4744
)
4845

4946
args = parser.parse_args()

build/zip.py

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,10 @@ def _zip_dir(path, zip_file, prefix):
2525
for file in files:
2626
if os.path.islink(os.path.join(root, file)):
2727
add_symlink(
28-
zip_file, os.path.join(root, file),
29-
os.path.join(root.replace(path, prefix), file)
28+
zip_file, os.path.join(root, file), os.path.join(root.replace(path, prefix), file)
3029
)
3130
continue
32-
zip_file.write(
33-
os.path.join(root, file),
34-
os.path.join(root.replace(path, prefix), file)
35-
)
31+
zip_file.write(os.path.join(root, file), os.path.join(root.replace(path, prefix), file))
3632

3733

3834
def add_symlink(zip_file, source, target):
@@ -80,12 +76,7 @@ def main(args):
8076

8177
if __name__ == '__main__':
8278
parser = argparse.ArgumentParser(description='This script creates zip files.')
83-
parser.add_argument(
84-
'-o',
85-
dest='output',
86-
action='store',
87-
help='The name of the output zip file.'
88-
)
79+
parser.add_argument('-o', dest='output', action='store', help='The name of the output zip file.')
8980
parser.add_argument(
9081
'-i',
9182
dest='input_pairs',
@@ -94,9 +85,6 @@ def main(args):
9485
help='The input file and its destination location in the zip archive.'
9586
)
9687
parser.add_argument(
97-
'-f',
98-
dest='source_file',
99-
action='store',
100-
help='The path to the file list to zip.'
88+
'-f', dest='source_file', action='store', help='The path to the file list to zip.'
10189
)
10290
sys.exit(main(parser.parse_args()))

ci/bin/format.dart

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,9 @@ abstract class FormatChecker {
269269
...types,
270270
]);
271271
}
272-
return output.split('\n').where((String line) => line.isNotEmpty).toList();
272+
return output.split('\n').where(
273+
(String line) => line.isNotEmpty && !line.contains('third_party')
274+
).toList();
273275
}
274276

275277
/// Generates a reporting function to supply to ProcessRunner to use instead
@@ -285,7 +287,7 @@ abstract class FormatChecker {
285287
final String pendingStr = pending.toString().padLeft(3);
286288
final String failedStr = failed.toString().padLeft(3);
287289

288-
stderr.write('$name Jobs: $percent% done, '
290+
stdout.write('$name Jobs: $percent% done, '
289291
'$completedStr/$totalStr completed, '
290292
'$inProgressStr in progress, '
291293
'$pendingStr pending, '
@@ -296,7 +298,7 @@ abstract class FormatChecker {
296298
/// Clears the last printed report line so garbage isn't left on the terminal.
297299
@protected
298300
void reportDone() {
299-
stderr.write('\r${' ' * 100}\r');
301+
stdout.write('\r${' ' * 100}\r');
300302
}
301303
}
302304

@@ -436,7 +438,7 @@ class ClangFormatChecker extends FormatChecker {
436438
} else {
437439
error('Found ${failed.length} C++/ObjC/Shader file${plural ? 's' : ''}'
438440
' which ${plural ? 'were' : 'was'} formatted incorrectly.');
439-
stdout.writeln('To fix, run:');
441+
stdout.writeln('To fix, run `et format` or:');
440442
stdout.writeln();
441443
stdout.writeln('git apply <<DONE');
442444
for (final WorkerJob job in failed) {
@@ -594,7 +596,7 @@ class JavaFormatChecker extends FormatChecker {
594596
} else {
595597
error('Found ${failed.length} Java file${plural ? 's' : ''}'
596598
' which ${plural ? 'were' : 'was'} formatted incorrectly.');
597-
stdout.writeln('To fix, run:');
599+
stdout.writeln('To fix, run `et format` or:');
598600
stdout.writeln();
599601
stdout.writeln('git apply <<DONE');
600602
for (final WorkerJob job in failed) {
@@ -727,7 +729,7 @@ class GnFormatChecker extends FormatChecker {
727729
} else {
728730
error('Found ${failed.length} GN file${plural ? 's' : ''}'
729731
' which ${plural ? 'were' : 'was'} formatted incorrectly.');
730-
stdout.writeln('To fix, run:');
732+
stdout.writeln('To fix, run `et format` or:');
731733
stdout.writeln();
732734
stdout.writeln('git apply <<DONE');
733735
for (final WorkerJob job in failed) {
@@ -822,7 +824,12 @@ class PythonFormatChecker extends FormatChecker {
822824
} else {
823825
error('Found ${incorrect.length} python file${plural ? 's' : ''}'
824826
' which ${plural ? 'were' : 'was'} formatted incorrectly:');
825-
incorrect.forEach(stderr.writeln);
827+
stdout.writeln('To fix, run `et format` or:');
828+
stdout.writeln();
829+
stdout.writeln('git apply <<DONE');
830+
incorrect.forEach(stdout.writeln);
831+
stdout.writeln('DONE');
832+
stdout.writeln();
826833
}
827834
} else {
828835
message('All python files formatted correctly.');
@@ -1129,7 +1136,7 @@ Future<int> main(List<String> arguments) async {
11291136
message ??= '';
11301137
switch (type) {
11311138
case MessageType.message:
1132-
stderr.writeln(message);
1139+
stdout.writeln(message);
11331140
case MessageType.error:
11341141
stderr.writeln('ERROR: $message');
11351142
case MessageType.warning:
@@ -1160,11 +1167,7 @@ Future<int> main(List<String> arguments) async {
11601167
message('Unable to apply $humanCheckName format fixes.');
11611168
}
11621169
} else {
1163-
message('Performing $humanCheckName format check');
11641170
stepResult = await checker.checkFormatting();
1165-
if (!stepResult) {
1166-
message('Found $humanCheckName format problems.');
1167-
}
11681171
}
11691172
result = result && stepResult;
11701173
}

0 commit comments

Comments
 (0)