Revert "Enable developers to run pod from terminal directly and skip pod install if possible. (#13374)" (#13770)
This reverts commit c6a17525e8ea63fef80325cdb8af2d6e5ca37f87.
diff --git a/packages/flutter_tools/test/ios/cocoapods_test.dart b/packages/flutter_tools/test/ios/cocoapods_test.dart
index 73c068d..493468f 100644
--- a/packages/flutter_tools/test/ios/cocoapods_test.dart
+++ b/packages/flutter_tools/test/ios/cocoapods_test.dart
@@ -41,7 +41,7 @@
when(mockProcessManager.run(
<String>['pod', 'install', '--verbose'],
workingDirectory: 'project/ios',
- environment: <String, String>{'COCOAPODS_DISABLE_STATS': 'true'},
+ environment: <String, String>{'FLUTTER_FRAMEWORK_DIR': 'engine/path', 'COCOAPODS_DISABLE_STATS': 'true'},
)).thenReturn(exitsHappy);
});
@@ -50,12 +50,13 @@
() async {
await cocoaPodsUnderTest.processPods(
appIosDir: projectUnderTest,
+ iosEngineDir: 'engine/path',
);
expect(fs.file(fs.path.join('project', 'ios', 'Podfile')).readAsStringSync() , 'Objective-C podfile template');
verify(mockProcessManager.run(
<String>['pod', 'install', '--verbose'],
workingDirectory: 'project/ios',
- environment: <String, String>{'COCOAPODS_DISABLE_STATS': 'true'},
+ environment: <String, String>{'FLUTTER_FRAMEWORK_DIR': 'engine/path', 'COCOAPODS_DISABLE_STATS': 'true'},
));
},
overrides: <Type, Generator>{
@@ -69,13 +70,14 @@
() async {
await cocoaPodsUnderTest.processPods(
appIosDir: projectUnderTest,
+ iosEngineDir: 'engine/path',
isSwift: true,
);
expect(fs.file(fs.path.join('project', 'ios', 'Podfile')).readAsStringSync() , 'Swift podfile template');
verify(mockProcessManager.run(
<String>['pod', 'install', '--verbose'],
workingDirectory: 'project/ios',
- environment: <String, String>{'COCOAPODS_DISABLE_STATS': 'true'},
+ environment: <String, String>{'FLUTTER_FRAMEWORK_DIR': 'engine/path', 'COCOAPODS_DISABLE_STATS': 'true'},
));
},
overrides: <Type, Generator>{
@@ -92,11 +94,12 @@
..writeAsString('Existing Podfile');
await cocoaPodsUnderTest.processPods(
appIosDir: projectUnderTest,
+ iosEngineDir: 'engine/path',
); expect(fs.file(fs.path.join('project', 'ios', 'Podfile')).readAsStringSync() , 'Existing Podfile');
verify(mockProcessManager.run(
<String>['pod', 'install', '--verbose'],
workingDirectory: 'project/ios',
- environment: <String, String>{'COCOAPODS_DISABLE_STATS': 'true'},
+ environment: <String, String>{'FLUTTER_FRAMEWORK_DIR': 'engine/path', 'COCOAPODS_DISABLE_STATS': 'true'},
));
},
overrides: <Type, Generator>{
@@ -112,13 +115,14 @@
try {
await cocoaPodsUnderTest.processPods(
appIosDir: projectUnderTest,
+ iosEngineDir: 'engine/path',
);
fail('Expected tool error');
} catch (ToolExit) {
verifyNever(mockProcessManager.run(
<String>['pod', 'install', '--verbose'],
workingDirectory: 'project/ios',
- environment: <String, String>{'COCOAPODS_DISABLE_STATS': 'true'},
+ environment: <String, String>{'FLUTTER_FRAMEWORK_DIR': 'engine/path', 'COCOAPODS_DISABLE_STATS': 'true'},
));
}
},
@@ -138,7 +142,7 @@
when(mockProcessManager.run(
<String>['pod', 'install', '--verbose'],
workingDirectory: 'project/ios',
- environment: <String, String>{'COCOAPODS_DISABLE_STATS': 'true'},
+ environment: <String, String>{'FLUTTER_FRAMEWORK_DIR': 'engine/path', 'COCOAPODS_DISABLE_STATS': 'true'},
)).thenReturn(new ProcessResult(
1,
1,
@@ -161,6 +165,7 @@
try {
await cocoaPodsUnderTest.processPods(
appIosDir: projectUnderTest,
+ iosEngineDir: 'engine/path',
); expect(fs.file(fs.path.join('project', 'ios', 'Podfile')).readAsStringSync() , 'Existing Podfile');
fail('Exception expected');
} catch (ToolExit) {
@@ -172,62 +177,6 @@
ProcessManager: () => mockProcessManager,
},
);
-
- testUsingContext(
- 'Run pod install if plugins or flutter framework have changes.',
- () async {
- fs.file(fs.path.join('project', 'ios', 'Podfile'))
- ..createSync()
- ..writeAsString('Existing Podfile');
- fs.file(fs.path.join('project', 'ios', 'Podfile.lock'))
- ..createSync()
- ..writeAsString('Existing lock files.');
- fs.file(fs.path.join('project', 'ios', 'Pods','Manifest.lock'))
- ..createSync(recursive: true)
- ..writeAsString('Existing lock files.');
- await cocoaPodsUnderTest.processPods(
- appIosDir: projectUnderTest,
- pluginOrFlutterPodChanged: true
- );
- verify(mockProcessManager.run(
- <String>['pod', 'install', '--verbose'],
- workingDirectory: 'project/ios',
- environment: <String, String>{'COCOAPODS_DISABLE_STATS': 'true'},
- ));
- },
- overrides: <Type, Generator>{
- FileSystem: () => fs,
- ProcessManager: () => mockProcessManager,
- },
- );
-
- testUsingContext(
- 'Skip pod install if plugins and flutter framework remain unchanged.',
- () async {
- fs.file(fs.path.join('project', 'ios', 'Podfile'))
- ..createSync()
- ..writeAsString('Existing Podfile');
- fs.file(fs.path.join('project', 'ios', 'Podfile.lock'))
- ..createSync()
- ..writeAsString('Existing lock files.');
- fs.file(fs.path.join('project', 'ios', 'Pods','Manifest.lock'))
- ..createSync(recursive: true)
- ..writeAsString('Existing lock files.');
- await cocoaPodsUnderTest.processPods(
- appIosDir: projectUnderTest,
- pluginOrFlutterPodChanged: false
- );
- verifyNever(mockProcessManager.run(
- <String>['pod', 'install', '--verbose'],
- workingDirectory: 'project/ios',
- environment: <String, String>{'COCOAPODS_DISABLE_STATS': 'true'},
- ));
- },
- overrides: <Type, Generator>{
- FileSystem: () => fs,
- ProcessManager: () => mockProcessManager,
- },
- );
}
class MockProcessManager extends Mock implements ProcessManager {}