Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions packages/flutter_tools/lib/src/ios/mac.dart
Original file line number Diff line number Diff line change
Expand Up @@ -357,10 +357,10 @@ Future<XcodeBuildResult> buildXcodeProject({
buildCommands.add('SCRIPT_OUTPUT_STREAM_FILE=${scriptOutputPipeFile.absolute.path}');
}

final File resultBundleFile = tempDir.childFile(_kResultBundlePath);
final Directory resultBundleDirectory = tempDir.childDirectory(_kResultBundlePath);
buildCommands.addAll(<String>[
'-resultBundlePath',
resultBundleFile.absolute.path,
resultBundleDirectory.absolute.path,
'-resultBundleVersion',
_kResultBundleVersion,
]);
Expand All @@ -382,7 +382,7 @@ Future<XcodeBuildResult> buildXcodeProject({
final Stopwatch sw = Stopwatch()..start();
initialBuildStatus = globals.logger.startProgress('Running Xcode build...');

buildResult = await _runBuildWithRetries(buildCommands, app, resultBundleFile);
buildResult = await _runBuildWithRetries(buildCommands, app, resultBundleDirectory);

// Notifies listener that no more output is coming.
scriptOutputPipeFile?.writeAsStringSync('all done');
Expand Down Expand Up @@ -512,14 +512,14 @@ Future<void> removeFinderExtendedAttributes(FileSystemEntity projectDirectory, P
}
}

Future<RunResult?> _runBuildWithRetries(List<String> buildCommands, BuildableIOSApp app, File resultBundleFile) async {
Future<RunResult?> _runBuildWithRetries(List<String> buildCommands, BuildableIOSApp app, Directory resultBundleDirectory) async {
int buildRetryDelaySeconds = 1;
int remainingTries = 8;

RunResult? buildResult;
while (remainingTries > 0) {
if (resultBundleFile.existsSync()) {
resultBundleFile.deleteSync(recursive: true);
if (resultBundleDirectory.existsSync()) {
resultBundleDirectory.deleteSync(recursive: true);
}
remainingTries--;
buildRetryDelaySeconds *= 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ void main() {
'xcresulttool',
'get',
'--path',
_xcBundleFilePath,
_xcBundleDirectoryPath,
'--format',
'json',
],
Expand Down Expand Up @@ -173,7 +173,7 @@ void main() {
'-destination',
'generic/platform=iOS',
],
'-resultBundlePath', _xcBundleFilePath,
'-resultBundlePath', _xcBundleDirectoryPath,
'-resultBundleVersion', '3',
'FLUTTER_SUPPRESS_ANALYTICS=true',
'COMPILER_INDEX_STORE_ENABLE=NO',
Expand Down Expand Up @@ -461,7 +461,7 @@ void main() {
ProcessManager: () => FakeProcessManager.list(<FakeCommand>[
xattrCommand,
setUpFakeXcodeBuildHandler(exitCode: 1, onRun: () {
fileSystem.systemTempDirectory.childDirectory(_xcBundleFilePath).createSync();
fileSystem.systemTempDirectory.childDirectory(_xcBundleDirectoryPath).createSync();
}),
setUpXCResultCommand(),
setUpRsyncCommand(),
Expand Down Expand Up @@ -495,7 +495,7 @@ void main() {
ProcessManager: () => FakeProcessManager.list(<FakeCommand>[
xattrCommand,
setUpFakeXcodeBuildHandler(exitCode: 1, onRun: () {
fileSystem.systemTempDirectory.childDirectory(_xcBundleFilePath).createSync();
fileSystem.systemTempDirectory.childDirectory(_xcBundleDirectoryPath).createSync();
}, stdout: 'Lots of spew from Xcode',
),
setUpXCResultCommand(stdout: kSampleResultJsonWithIssues),
Expand Down Expand Up @@ -530,7 +530,7 @@ void main() {
ProcessManager: () => FakeProcessManager.list(<FakeCommand>[
xattrCommand,
setUpFakeXcodeBuildHandler(exitCode: 1, onRun: () {
fileSystem.systemTempDirectory.childDirectory(_xcBundleFilePath).createSync();
fileSystem.systemTempDirectory.childDirectory(_xcBundleDirectoryPath).createSync();
}),
setUpXCResultCommand(stdout: kSampleResultJsonWithIssuesToBeDiscarded),
setUpRsyncCommand(),
Expand Down Expand Up @@ -594,7 +594,7 @@ void main() {
ProcessManager: () => FakeProcessManager.list(<FakeCommand>[
xattrCommand,
setUpFakeXcodeBuildHandler(exitCode: 1, onRun: () {
fileSystem.systemTempDirectory.childDirectory(_xcBundleFilePath).createSync();
fileSystem.systemTempDirectory.childDirectory(_xcBundleDirectoryPath).createSync();
}),
setUpXCResultCommand(stdout: kSampleResultJsonWithProvisionIssue),
setUpRsyncCommand(),
Expand Down Expand Up @@ -628,7 +628,7 @@ void main() {
setUpFakeXcodeBuildHandler(
exitCode: 1,
onRun: () {
fileSystem.systemTempDirectory.childDirectory(_xcBundleFilePath).createSync();
fileSystem.systemTempDirectory.childDirectory(_xcBundleDirectoryPath).createSync();
}
),
setUpXCResultCommand(stdout: kSampleResultJsonWithNoProvisioningProfileIssue),
Expand Down Expand Up @@ -661,17 +661,17 @@ void main() {
exitCode: 1,
stdout: '$kConcurrentRunFailureMessage1 $kConcurrentRunFailureMessage2',
onRun: () {
fileSystem.systemTempDirectory.childFile(_xcBundleFilePath).createSync();
fileSystem.systemTempDirectory.childDirectory(_xcBundleDirectoryPath).childFile('result.xcresult').createSync(recursive: true);
}
),
// The second xcodebuild is triggered due to above concurrent run failure message.
setUpFakeXcodeBuildHandler(
onRun: () {
// If the file is not cleaned, throw an error, test failure.
if (fileSystem.systemTempDirectory.childFile(_xcBundleFilePath).existsSync()) {
if (fileSystem.systemTempDirectory.childDirectory(_xcBundleDirectoryPath).existsSync()) {
throwToolExit('xcresult bundle file existed.', exitCode: 2);
}
fileSystem.systemTempDirectory.childFile(_xcBundleFilePath).createSync();
fileSystem.systemTempDirectory.childDirectory(_xcBundleDirectoryPath).childFile('result.xcresult').createSync(recursive: true);
}
),
setUpXCResultCommand(stdout: kSampleResultJsonNoIssues),
Expand Down Expand Up @@ -709,7 +709,7 @@ void main() {
Runner requires a provisioning profile. Select a provisioning profile in the Signing & Capabilities editor
''',
onRun: () {
fileSystem.systemTempDirectory.childDirectory(_xcBundleFilePath).createSync();
fileSystem.systemTempDirectory.childDirectory(_xcBundleDirectoryPath).createSync();
}
),
setUpXCResultCommand(stdout: kSampleResultJsonInvalidIssuesMap),
Expand Down Expand Up @@ -743,7 +743,7 @@ Runner requires a provisioning profile. Select a provisioning profile in the Sig
setUpFakeXcodeBuildHandler(
exitCode: 1,
onRun: () {
fileSystem.systemTempDirectory.childDirectory(_xcBundleFilePath).createSync();
fileSystem.systemTempDirectory.childDirectory(_xcBundleDirectoryPath).createSync();
}
),
setUpXCResultCommand(stdout: kSampleResultJsonInvalidIssuesMap),
Expand Down Expand Up @@ -780,7 +780,7 @@ Runner requires a provisioning profile. Select a provisioning profile in the Sig
Runner requires a provisioning profile. Select a provisioning profile in the Signing & Capabilities editor
''',
onRun: () {
fileSystem.systemTempDirectory.childDirectory(_xcBundleFilePath).createSync();
fileSystem.systemTempDirectory.childDirectory(_xcBundleDirectoryPath).createSync();
}
),
setUpXCResultCommand(stdout: kSampleResultJsonNoIssues),
Expand Down Expand Up @@ -815,7 +815,7 @@ Runner requires a provisioning profile. Select a provisioning profile in the Sig
setUpFakeXcodeBuildHandler(
exitCode: 1,
onRun: () {
fileSystem.systemTempDirectory.childDirectory(_xcBundleFilePath).createSync();
fileSystem.systemTempDirectory.childDirectory(_xcBundleDirectoryPath).createSync();
}
),
setUpXCResultCommand(stdout: kSampleResultJsonInvalidIssuesMap),
Expand Down Expand Up @@ -850,7 +850,7 @@ Runner requires a provisioning profile. Select a provisioning profile in the Sig
setUpFakeXcodeBuildHandler(
exitCode: 1,
onRun: () {
fileSystem.systemTempDirectory.childDirectory(_xcBundleFilePath).createSync();
fileSystem.systemTempDirectory.childDirectory(_xcBundleDirectoryPath).createSync();
}
),
setUpXCResultCommand(stdout: kSampleResultJsonWithNoProvisioningProfileIssue),
Expand Down Expand Up @@ -885,7 +885,7 @@ Runner requires a provisioning profile. Select a provisioning profile in the Sig
setUpFakeXcodeBuildHandler(
exitCode: 1,
onRun: () {
fileSystem.systemTempDirectory.childDirectory(_xcBundleFilePath).createSync();
fileSystem.systemTempDirectory.childDirectory(_xcBundleDirectoryPath).createSync();
}
),
setUpXCResultCommand(stdout: kSampleResultJsonWithProvisionIssue),
Expand Down Expand Up @@ -922,7 +922,7 @@ Runner requires a provisioning profile. Select a provisioning profile in the Sig
simulator: true,
exitCode: 1,
onRun: () {
fileSystem.systemTempDirectory.childDirectory(_xcBundleFilePath).createSync();
fileSystem.systemTempDirectory.childDirectory(_xcBundleDirectoryPath).createSync();
},
),
setUpXCResultCommand(),
Expand Down Expand Up @@ -958,7 +958,7 @@ Runner requires a provisioning profile. Select a provisioning profile in the Sig
simulator: true,
exitCode: 1,
onRun: () {
fileSystem.systemTempDirectory.childDirectory(_xcBundleFilePath).createSync();
fileSystem.systemTempDirectory.childDirectory(_xcBundleDirectoryPath).createSync();
},
),
setUpXCResultCommand(stdout: kSampleResultJsonWithIssues),
Expand Down Expand Up @@ -996,7 +996,7 @@ Runner requires a provisioning profile. Select a provisioning profile in the Sig
simulator: true,
exitCode: 1,
onRun: () {
fileSystem.systemTempDirectory.childDirectory(_xcBundleFilePath).createSync();
fileSystem.systemTempDirectory.childDirectory(_xcBundleDirectoryPath).createSync();
},
),
setUpXCResultCommand(stdout: kSampleResultJsonWithIssuesToBeDiscarded),
Expand Down Expand Up @@ -1040,7 +1040,7 @@ Runner requires a provisioning profile. Select a provisioning profile in the Sig
});
}

const String _xcBundleFilePath = '/.tmp_rand0/flutter_ios_build_temp_dirrand0/temporary_xcresult_bundle';
const String _xcBundleDirectoryPath = '/.tmp_rand0/flutter_ios_build_temp_dirrand0/temporary_xcresult_bundle';

class FakeAndroidSdk extends Fake implements AndroidSdk {
@override
Expand Down