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

Commit f050c8c

Browse files
committed
Skip Podfile change on non-macOS platforms.
The Podfile is only generated on a macOS host.
1 parent b8573eb commit f050c8c

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

script/tool/lib/src/create_all_plugins_app_command.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,11 @@ dev_dependencies:${_pubspecMapString(pubspec.devDependencies)}
288288
}
289289

290290
Future<void> _updateMacosPodfile() async {
291+
// Only change the macOS deployment target if the host platform is macOS.
292+
if (!io.Platform.isMacOS) {
293+
return;
294+
}
295+
291296
final File podfileFile =
292297
app.platformDirectory(FlutterPlatform.macos).childFile('Podfile');
293298
if (!podfileFile.existsSync()) {

script/tool/test/create_all_plugins_app_command_test.dart

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,23 +103,28 @@ void main() {
103103
baselinePubspec.environment?[dartSdkKey]);
104104
});
105105

106-
test('macOS deployment target is modified', () async {
106+
test('macOS deployment target is modified in Podfile', () async {
107107
await runCapturingPrint(runner, <String>['all-plugins-app']);
108-
109108
final List<String> podfile = command.app
110109
.platformDirectory(FlutterPlatform.macos)
111110
.childFile('Podfile')
112111
.readAsLinesSync();
113-
final List<String> pbxproj = command.app
114-
.platformDirectory(FlutterPlatform.macos)
115-
.childDirectory('Runner.xcodeproj')
116-
.childFile('project.pbxproj')
117-
.readAsLinesSync();
118112

119113
expect(
120114
podfile,
121115
everyElement((String line) =>
122116
!line.contains('platform :osx') || line.contains("'10.15'")));
117+
},
118+
// Podfile is only generated on macOS.
119+
skip: !io.Platform.isMacOS);
120+
121+
test('macOS deployment target is modified in pbxproj', () async {
122+
await runCapturingPrint(runner, <String>['all-plugins-app']);
123+
final List<String> pbxproj = command.app
124+
.platformDirectory(FlutterPlatform.macos)
125+
.childDirectory('Runner.xcodeproj')
126+
.childFile('project.pbxproj')
127+
.readAsLinesSync();
123128

124129
expect(
125130
pbxproj,

0 commit comments

Comments
 (0)