anchor.diff:          ..createSync(recursive: true)
           ..writeAsStringSync('Existing release config');
   
  -      final FlutterProject project = FlutterProject.fromDirectoryTest(globals.fs.directory('project'));
  +      final FlutterProject project = FlutterProject.fromDirectoryTest(fileSystem.directory('project'));
         await cocoaPodsUnderTest.setupPodfile(project.ios);
  +
  +      final String debugContents = projectUnderTest.ios.xcodeConfigFor('Debug').readAsStringSync();
  +      expect(debugContents, contains(
  +          '#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"\n'));
  +      expect(debugContents, contains('Existing debug config'));
  +      final String releaseContents = projectUnderTest.ios.xcodeConfigFor('Release').readAsStringSync();
  +      expect(releaseContents, contains(
  +          '#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"\n'));
  +      expect(releaseContents, contains('Existing release config'));
  +    });
  +
  +    testWithoutContext('does not include Pod config in xcconfig files, if legacy non-option include present', () async {
  +      projectUnderTest.ios.podfile..createSync()..writeAsStringSync('Existing Podfile');
  +
  +      const String legacyDebugInclude = '#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig';
  +      projectUnderTest.ios.xcodeConfigFor('Debug')
  +        ..createSync(recursive: true)
  +        ..writeAsStringSync(legacyDebugInclude);
  +      const String legacyReleaseInclude = '#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig';
  +      projectUnderTest.ios.xcodeConfigFor('Release')
  +        ..createSync(recursive: true)
  +        ..writeAsStringSync(legacyReleaseInclude);
  +
  +      final FlutterProject project = FlutterProject.fromDirectoryTest(fileSystem.directory('project'));
  +      await cocoaPodsUnderTest.setupPodfile(project.ios);
  +
  +      final String debugContents = projectUnderTest.ios.xcodeConfigFor('Debug').readAsStringSync();
  +      // Redundant contains check, but this documents what we're testing--that the optional
  +      // #include? doesn't get written in addition to the previous style #include.
  +      expect(debugContents, isNot(contains('#include?')));
  +      expect(debugContents, equals(legacyDebugInclude));
  +      final String releaseContents = projectUnderTest.ios.xcodeConfigFor('Release').readAsStringSync();
  +      expect(releaseContents, isNot(contains('#include?')));
  +      expect(releaseContents, equals(legacyReleaseInclude));
  +    });
  +  });
  +
  +  group('Update xcconfig', () {
  +    testUsingContext('includes Pod config in xcconfig files, if the user manually added Pod dependencies without using Flutter plugins', () async {
  +      fileSystem.file(fileSystem.path.join('project', 'foo', '.packages'))
  +        ..createSync(recursive: true)
  +        ..writeAsStringSync('\n');
  +      projectUnderTest.ios.podfile..createSync()..writeAsStringSync('Custom Podfile');
  +      projectUnderTest.ios.podfileLock..createSync()..writeAsStringSync('Podfile.lock from user executed `pod install`');
  +      projectUnderTest.packagesFile..createSync()..writeAsStringSync('');
  +      projectUnderTest.ios.xcodeConfigFor('Debug')
  +        ..createSync(recursive: true)
  +        ..writeAsStringSync('Existing debug config');
  +      projectUnderTest.ios.xcodeConfigFor('Release')
  +        ..createSync(recursive: true)
  +        ..writeAsStringSync('Existing release config');
  +
  +      final FlutterProject project = FlutterProject.fromDirectoryTest(fileSystem.directory('project'));
  +      await injectPlugins(project, iosPlatform: true);
   
         final String debugContents = projectUnderTest.ios.xcodeConfigFor('Debug').readAsStringSync();
         expect(debugContents, contains(
  
positive.code:   });
  }
  
  class MockXcodeProjectInterpreter extends Mock implements XcodeProjectInterpreter {}
  
negative.code: void main() {
    FileSystem fileSystem;
    FakeProcessManager fakeProcessManager;
    FlutterProject projectUnderTest;
    CocoaPods cocoaPodsUnderTest;
    BufferLogger logger;
  