Skip to content

Commit c5d046c

Browse files
authored
continue->next in Ruby script (flutter#104296)
1 parent 8dc5121 commit c5d046c

File tree

4 files changed

+50
-23
lines changed

4 files changed

+50
-23
lines changed

packages/flutter_tools/bin/podhelper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def flutter_additional_ios_build_settings(target)
6060
# Profile can't be derived from the CocoaPods build configuration. Use release framework (for linking only).
6161
configuration_engine_dir = build_configuration.type == :debug ? debug_framework_dir : release_framework_dir
6262
Dir.new(configuration_engine_dir).each_child do |xcframework_file|
63-
continue if xcframework_file.start_with?(".") # Hidden file, possibly on external disk.
63+
next if xcframework_file.start_with?(".") # Hidden file, possibly on external disk.
6464
if xcframework_file.end_with?("-simulator") # ios-arm64_x86_64-simulator
6565
build_configuration.build_settings['FRAMEWORK_SEARCH_PATHS[sdk=iphonesimulator*]'] = "\"#{configuration_engine_dir}/#{xcframework_file}\" $(inherited)"
6666
elsif xcframework_file.start_with?("ios-") # ios-arm64

packages/flutter_tools/test/host_cross_arch.shard/ios_content_validation_test.dart

Lines changed: 45 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
// @dart = 2.8
6-
75
import 'package:file_testing/file_testing.dart';
86
import 'package:flutter_tools/src/base/file_system.dart';
97
import 'package:flutter_tools/src/base/io.dart';
@@ -15,11 +13,12 @@ import '../src/darwin_common.dart';
1513

1614
void main() {
1715
group('iOS app validation', () {
18-
String flutterRoot;
19-
Directory pluginRoot;
20-
String projectRoot;
21-
String flutterBin;
22-
Directory tempDir;
16+
late String flutterRoot;
17+
late Directory pluginRoot;
18+
late String projectRoot;
19+
late String flutterBin;
20+
late Directory tempDir;
21+
late File hiddenFile;
2322

2423
setUpAll(() {
2524
flutterRoot = getFlutterRoot();
@@ -30,6 +29,29 @@ void main() {
3029
'flutter',
3130
);
3231

32+
final Directory xcframeworkArtifact = fileSystem.directory(
33+
fileSystem.path.join(
34+
flutterRoot,
35+
'bin',
36+
'cache',
37+
'artifacts',
38+
'engine',
39+
'ios',
40+
'Flutter.xcframework',
41+
),
42+
);
43+
44+
// Pre-cache iOS engine Flutter.xcframework artifacts.
45+
processManager.runSync(<String>[
46+
flutterBin,
47+
...getLocalEngineArguments(),
48+
'precache',
49+
'--ios',
50+
], workingDirectory: tempDir.path);
51+
52+
// Pretend the SDK was on an external drive with stray "._" files in the xcframework
53+
hiddenFile = xcframeworkArtifact.childFile('._Info.plist')..createSync();
54+
3355
// Test a plugin example app to allow plugins validation.
3456
processManager.runSync(<String>[
3557
flutterBin,
@@ -47,22 +69,24 @@ void main() {
4769
});
4870

4971
tearDownAll(() {
72+
tryToDelete(hiddenFile);
5073
tryToDelete(tempDir);
5174
});
5275

5376
for (final BuildMode buildMode in <BuildMode>[BuildMode.debug, BuildMode.release]) {
5477
group('build in ${buildMode.name} mode', () {
55-
Directory buildPath;
56-
Directory outputApp;
57-
Directory frameworkDirectory;
58-
Directory outputFlutterFramework;
59-
File outputFlutterFrameworkBinary;
60-
Directory outputAppFramework;
61-
File outputAppFrameworkBinary;
62-
File outputPluginFrameworkBinary;
78+
late Directory buildPath;
79+
late Directory outputApp;
80+
late Directory frameworkDirectory;
81+
late Directory outputFlutterFramework;
82+
late File outputFlutterFrameworkBinary;
83+
late Directory outputAppFramework;
84+
late File outputAppFrameworkBinary;
85+
late File outputPluginFrameworkBinary;
86+
late ProcessResult buildResult;
6387

6488
setUpAll(() {
65-
processManager.runSync(<String>[
89+
buildResult = processManager.runSync(<String>[
6690
flutterBin,
6791
...getLocalEngineArguments(),
6892
'build',
@@ -94,6 +118,11 @@ void main() {
94118
});
95119

96120
testWithoutContext('flutter build ios builds a valid app', () {
121+
printOnFailure('Output of flutter build ios:');
122+
printOnFailure(buildResult.stdout.toString());
123+
printOnFailure(buildResult.stderr.toString());
124+
expect(buildResult.exitCode, 0);
125+
97126
expect(outputPluginFrameworkBinary, exists);
98127

99128
expect(outputAppFrameworkBinary, exists);

packages/flutter_tools/test/host_cross_arch.shard/macos_content_validation_test.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
// @dart = 2.8
6-
75
import 'package:file_testing/file_testing.dart';
86
import 'package:flutter_tools/src/base/file_system.dart';
97
import 'package:flutter_tools/src/base/io.dart';

packages/flutter_tools/test/src/common.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,19 @@ import 'package:test_api/test_api.dart' hide test; // ignore: deprecated_member_
1818

1919
export 'package:test_api/test_api.dart' hide test, isInstanceOf; // ignore: deprecated_member_use
2020

21-
void tryToDelete(Directory directory) {
21+
void tryToDelete(FileSystemEntity fileEntity) {
2222
// This should not be necessary, but it turns out that
2323
// on Windows it's common for deletions to fail due to
2424
// bogus (we think) "access denied" errors.
2525
try {
26-
if (directory.existsSync()) {
27-
directory.deleteSync(recursive: true);
26+
if (fileEntity.existsSync()) {
27+
fileEntity.deleteSync(recursive: true);
2828
}
2929
} on FileSystemException catch (error) {
3030
// We print this so that it's visible in the logs, to get an idea of how
3131
// common this problem is, and if any patterns are ever noticed by anyone.
3232
// ignore: avoid_print
33-
print('Failed to delete ${directory.path}: $error');
33+
print('Failed to delete ${fileEntity.path}: $error');
3434
}
3535
}
3636

0 commit comments

Comments
 (0)